From: Carsten Kroll Date: Thu, 24 Feb 2011 12:56:04 +0000 (+0100) Subject: dvdemux: First try if upstream handles TIME seeks before handling them here X-Git-Tag: RELEASE-0.10.29~580 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4eaff5e88c9b34a9e33ddaa9bb83859b2c37446;p=platform%2Fupstream%2Fgst-plugins-good.git dvdemux: First try if upstream handles TIME seeks before handling them here Fixes bug #642963. --- diff --git a/ext/dv/gstdvdemux.c b/ext/dv/gstdvdemux.c index 5261d47..c1ecd92 100644 --- a/ext/dv/gstdvdemux.c +++ b/ext/dv/gstdvdemux.c @@ -895,17 +895,13 @@ gst_dvdemux_convert_segment (GstDVDemux * dvdemux, GstSegment * src, * * Convert the time seek to a bytes seek and send it * upstream - * - * FIXME, upstream might be able to perform time based - * seek too. - * * Does not take ownership of the event. */ static gboolean gst_dvdemux_handle_push_seek (GstDVDemux * dvdemux, GstPad * pad, GstEvent * event) { - gboolean res; + gboolean res = FALSE; gdouble rate; GstSeekFlags flags; GstFormat format; @@ -917,19 +913,24 @@ gst_dvdemux_handle_push_seek (GstDVDemux * dvdemux, GstPad * pad, gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur, &stop_type, &stop); - /* we convert the start/stop on the srcpad to the byte format - * on the sinkpad and forward the event */ - res = gst_dvdemux_convert_src_to_sink (dvdemux, pad, - format, cur, stop, GST_FORMAT_BYTES, &start_position, &end_position); - if (!res) - goto done; + /* First try if upstream can handle time based seeks */ + if (format == GST_FORMAT_TIME) + res = gst_pad_push_event (dvdemux->sinkpad, event); - /* now this is the updated seek event on bytes */ - newevent = gst_event_new_seek (rate, GST_FORMAT_BYTES, flags, - cur_type, start_position, stop_type, end_position); + if (!res) { + /* we convert the start/stop on the srcpad to the byte format + * on the sinkpad and forward the event */ + res = gst_dvdemux_convert_src_to_sink (dvdemux, pad, + format, cur, stop, GST_FORMAT_BYTES, &start_position, &end_position); + if (!res) + goto done; - res = gst_pad_push_event (dvdemux->sinkpad, newevent); + /* now this is the updated seek event on bytes */ + newevent = gst_event_new_seek (rate, GST_FORMAT_BYTES, flags, + cur_type, start_position, stop_type, end_position); + res = gst_pad_push_event (dvdemux->sinkpad, newevent); + } done: return res; }