Commit 0906d822 authored by Thiago Santos's avatar Thiago Santos

qtdemux: drop flushes from our own offset seek

Prevents downstream from receiving flushes for a seek only in
upstream. Those seeks are only to start reading from the right
offset when skipping or returning to qt atoms.

https://bugzilla.gnome.org/show_bug.cgi?id=758928
parent 7b026e4b
......@@ -2127,6 +2127,14 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
res = TRUE;
goto drop;
}
case GST_EVENT_FLUSH_START:
{
if (gst_event_get_seqnum (event) == demux->offset_seek_seqnum) {
gst_event_unref (event);
goto drop;
}
break;
}
case GST_EVENT_FLUSH_STOP:
{
guint64 dur;
......@@ -2134,6 +2142,11 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
dur = demux->segment.duration;
gst_qtdemux_reset (demux, FALSE);
demux->segment.duration = dur;
if (gst_event_get_seqnum (event) == demux->offset_seek_seqnum) {
gst_event_unref (event);
goto drop;
}
break;
}
case GST_EVENT_EOS:
......@@ -5478,7 +5491,10 @@ qtdemux_seek_offset (GstQTDemux * demux, guint64 offset)
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, GST_SEEK_TYPE_SET, offset,
GST_SEEK_TYPE_NONE, -1);
/* store seqnum to drop flush events, they don't need to reach downstream */
demux->offset_seek_seqnum = gst_event_get_seqnum (event);
res = gst_pad_push_event (demux->sinkpad, event);
demux->offset_seek_seqnum = 0;
return res;
}
......
......@@ -121,6 +121,7 @@ struct _GstQTDemux {
* newsegment in TIME format which likely
* means that upstream is driving the pipeline
* (adaptive demuxers / dlna) */
guint32 offset_seek_seqnum;
gint64 seek_offset;
gint64 push_seek_start;
gint64 push_seek_stop;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment