summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-12-21 09:57:33 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2015-12-22 12:33:39 -0300
commit0906d822ad3661ad78376494e2d5680a795ff1c6 (patch)
treefab71f7f3205b40c4bc73f7ade3450e8c101e61b
parent7b026e4bc027e8be2378870c949f5a3182ba37e1 (diff)
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
-rw-r--r--gst/isomp4/qtdemux.c16
-rw-r--r--gst/isomp4/qtdemux.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index 378982d9f..77bb73e8d 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -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;
}
diff --git a/gst/isomp4/qtdemux.h b/gst/isomp4/qtdemux.h
index 05cd80646..53bd071c3 100644
--- a/gst/isomp4/qtdemux.h
+++ b/gst/isomp4/qtdemux.h
@@ -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;