summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2016-03-07 10:28:06 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2016-03-07 15:26:13 -0300
commitd8fb7a9c96b108814beeaa0e63f818d4648c7fe9 (patch)
tree67407f870afdd8c89a1f904f8e29f6b44a225d90
parentb46af7fda7dcbf263e99090922bfa835e288cfa5 (diff)
downloadgstreamer-plugins-good-d8fb7a9c96b108814beeaa0e63f818d4648c7fe9.tar.gz
qtdemux: reset pending segment if we are already pushing one
When upstream is running in bytes in push-mode, qtdemux will convert seeks from time to bytes and send it upstream. Upstream element will perform a byte seek and send a byte segment to qtdemux that will convert it to time and push it downstream. There is, however, the pending_segment variable that stores a new segment event to be pushed before the next data. When handling seeks as mentioned above this variable was being ignored and, if it contained some segment event, it would override the one resulting from the seek. This would restore a previous segment and would cause the seek segment to be discarded downstream. This patch fixes this issue by unrefing any pending segment as the seek from upstream should contain the latest one that should be used, as requested by the application. https://bugzilla.gnome.org/show_bug.cgi?id=763165
-rw-r--r--gst/isomp4/qtdemux.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index 1085e2005..48f7f7a3a 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -2105,6 +2105,8 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
GST_DEBUG_OBJECT (demux, "Pushing newseg %" GST_SEGMENT_FORMAT, &segment);
segment_event = gst_event_new_segment (&segment);
gst_event_set_seqnum (segment_event, gst_event_get_seqnum (event));
+ /* erase any previously set segment */
+ gst_event_replace (&demux->pending_newsegment, NULL);
gst_qtdemux_push_event (demux, segment_event);
/* clear leftover in current segment, if any */