dvdemux: First try if upstream handles TIME seeks before handling them here

Fixes bug #642963.
This commit is contained in:
Carsten Kroll 2011-02-24 13:56:04 +01:00 committed by Sebastian Dröge
parent 6607cdcc08
commit d4eaff5e88

View File

@ -895,17 +895,13 @@ gst_dvdemux_convert_segment (GstDVDemux * dvdemux, GstSegment * src,
* *
* Convert the time seek to a bytes seek and send it * Convert the time seek to a bytes seek and send it
* upstream * upstream
*
* FIXME, upstream might be able to perform time based
* seek too.
*
* Does not take ownership of the event. * Does not take ownership of the event.
*/ */
static gboolean static gboolean
gst_dvdemux_handle_push_seek (GstDVDemux * dvdemux, GstPad * pad, gst_dvdemux_handle_push_seek (GstDVDemux * dvdemux, GstPad * pad,
GstEvent * event) GstEvent * event)
{ {
gboolean res; gboolean res = FALSE;
gdouble rate; gdouble rate;
GstSeekFlags flags; GstSeekFlags flags;
GstFormat format; GstFormat format;
@ -917,6 +913,11 @@ gst_dvdemux_handle_push_seek (GstDVDemux * dvdemux, GstPad * pad,
gst_event_parse_seek (event, &rate, &format, &flags, gst_event_parse_seek (event, &rate, &format, &flags,
&cur_type, &cur, &stop_type, &stop); &cur_type, &cur, &stop_type, &stop);
/* First try if upstream can handle time based seeks */
if (format == GST_FORMAT_TIME)
res = gst_pad_push_event (dvdemux->sinkpad, event);
if (!res) {
/* we convert the start/stop on the srcpad to the byte format /* we convert the start/stop on the srcpad to the byte format
* on the sinkpad and forward the event */ * on the sinkpad and forward the event */
res = gst_dvdemux_convert_src_to_sink (dvdemux, pad, res = gst_dvdemux_convert_src_to_sink (dvdemux, pad,
@ -929,7 +930,7 @@ gst_dvdemux_handle_push_seek (GstDVDemux * dvdemux, GstPad * pad,
cur_type, start_position, stop_type, end_position); cur_type, start_position, stop_type, end_position);
res = gst_pad_push_event (dvdemux->sinkpad, newevent); res = gst_pad_push_event (dvdemux->sinkpad, newevent);
}
done: done:
return res; return res;
} }