matroskademux: Implement SEGMENT query

This commit is contained in:
Sebastian Dröge 2013-07-29 10:53:54 +02:00
parent d135373beb
commit 722ef42196

View file

@ -1505,6 +1505,34 @@ gst_matroska_demux_query (GstMatroskaDemux * demux, GstPad * pad,
GST_OBJECT_UNLOCK (demux); GST_OBJECT_UNLOCK (demux);
break; break;
} }
case GST_QUERY_SEGMENT:
{
GstFormat format;
gint64 start, stop;
format = demux->common.segment.format;
start =
gst_segment_to_stream_time (&demux->common.segment, format,
demux->common.segment.start);
if ((stop = demux->common.segment.stop) == -1)
stop = demux->common.segment.duration;
else
stop =
gst_segment_to_stream_time (&demux->common.segment, format, stop);
if (demux->common.segment.rate < 0.0) {
gint64 tmp;
tmp = stop;
stop = start;
start = tmp;
}
gst_query_set_segment (query, demux->common.segment.rate, format, start,
stop);
res = TRUE;
break;
}
default: default:
if (pad) if (pad)
res = gst_pad_query_default (pad, (GstObject *) demux, query); res = gst_pad_query_default (pad, (GstObject *) demux, query);