After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785941 - fix flushing seek in rtmpsrc
fix flushing seek in rtmpsrc
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.12.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-07 11:32 UTC by George Kiagiadakis
Modified: 2017-08-11 08:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtmpsrc: implement unlock_stop() to fix flushing seek (6.19 KB, patch)
2017-08-07 11:32 UTC, George Kiagiadakis
none Details | Review
rtmpsrc: fix flushing seek (4.54 KB, patch)
2017-08-08 09:04 UTC, George Kiagiadakis
committed Details | Review

Description George Kiagiadakis 2017-08-07 11:32:15 UTC
Created attachment 357106 [details] [review]
rtmpsrc: implement unlock_stop() to fix flushing seek

Previously this was broken, because a flushing seek causes unlock() to be called and in the implementation of unlock() we close the socket, so the seek errors out.
    
This patch fixes it by re-connecting in unlock_stop().
Unfortunately, a seek does not work properly right after re-connecting, so a small hack is also in place: we read 1 buffer before seeking to allow librtmp to do its processing in RTMP_Read()
Comment 1 Sebastian Dröge (slomo) 2017-08-08 07:59:23 UTC
Comment on attachment 357106 [details] [review]
rtmpsrc: implement unlock_stop() to fix flushing seek

It would be better to reconnect in create() later, unlock_stop() should be more or less a no-op and not do any blocking network I/O
Comment 2 George Kiagiadakis 2017-08-08 09:04:03 UTC
Created attachment 357175 [details] [review]
rtmpsrc: fix flushing seek

You are right, it looks cleaner this way.
Comment 3 George Kiagiadakis 2017-08-08 13:02:18 UTC
commit f0500ec8b429b2ad44ac053982022f16296f51fd
Author: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date:   Mon Aug 7 14:25:26 2017 +0300

    rtmpsrc: fix flushing seek
    
    Previously this was broken, because a flushing seek causes unlock()
    to be called and in the implementation of unlock() we close the
    socket, so the seek errors out.
    
    This patch fixes it by re-connecting before the seek.
    Unfortunately, a seek does not work properly right after
    re-connecting, so a small hack is also in place: we read 1 buffer
    before seeking to allow librtmp to do its processing in RTMP_Read()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785941