summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-08-22 10:46:35 +0200
committerThiago Santos <thiagoss@osg.samsung.com>2014-09-16 12:13:41 -0300
commit07f2043e58223c3a8704476b5857210e7069529c (patch)
tree9e450df4e19b34dddc87eca21062f1d44288eeec /gst
parent8dff7bb38db2932605df604dc08f55a8de290b61 (diff)
asfdemux: first try to delegate TIME seek events upstream
We should give a chance to upstream to handle TIME seek events before trying to handle it in asfdemux. Fix a bug where fast backward seeks where discarded right away because they were not supported by asfdemux. https://bugzilla.gnome.org/show_bug.cgi?id=734471
Diffstat (limited to 'gst')
-rw-r--r--gst/asfdemux/gstasfdemux.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index e140b4ea..7eb3f2dc 100644
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -623,6 +623,19 @@ gst_asf_demux_handle_seek_event (GstASFDemux * demux, GstEvent * event)
guint32 seqnum;
GstEvent *fevent;
+ gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur,
+ &stop_type, &stop);
+
+ if (G_UNLIKELY (format != GST_FORMAT_TIME)) {
+ GST_LOG_OBJECT (demux, "seeking is only supported in TIME format");
+ return FALSE;
+ }
+
+ /* upstream might handle TIME seek, e.g. mms or rtsp, or not, e.g. http,
+ * so first try to let it handle the seek event. */
+ if (gst_pad_push_event (demux->sinkpad, gst_event_ref (event)))
+ return TRUE;
+
if (G_UNLIKELY (demux->seekable == FALSE || demux->packet_size == 0 ||
demux->num_packets == 0 || demux->play_time == 0)) {
GST_LOG_OBJECT (demux, "stream is not seekable");
@@ -634,20 +647,12 @@ gst_asf_demux_handle_seek_event (GstASFDemux * demux, GstEvent * event)
return FALSE;
}
- gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur,
- &stop_type, &stop);
- seqnum = gst_event_get_seqnum (event);
-
- if (G_UNLIKELY (format != GST_FORMAT_TIME)) {
- GST_LOG_OBJECT (demux, "seeking is only supported in TIME format");
- return FALSE;
- }
-
if (G_UNLIKELY (rate <= 0.0)) {
GST_LOG_OBJECT (demux, "backward playback is not supported yet");
return FALSE;
}
+ seqnum = gst_event_get_seqnum (event);
flush = ((flags & GST_SEEK_FLAG_FLUSH) == GST_SEEK_FLAG_FLUSH);
demux->accurate =
((flags & GST_SEEK_FLAG_ACCURATE) == GST_SEEK_FLAG_ACCURATE);
@@ -668,13 +673,7 @@ gst_asf_demux_handle_seek_event (GstASFDemux * demux, GstEvent * event)
GST_LOG_OBJECT (demux, "streaming; end position must be NONE");
return FALSE;
}
- gst_event_ref (event);
- /* upstream might handle TIME seek, e.g. mms or rtsp,
- * or not, e.g. http, then we give it a hand */
- if (!gst_pad_push_event (demux->sinkpad, event))
- return gst_asf_demux_handle_seek_push (demux, event);
- else
- return TRUE;
+ return gst_asf_demux_handle_seek_push (demux, event);
}
/* unlock the streaming thread */