mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
flvdemux: Implement SEGMENT query
This commit is contained in:
parent
4e78974c87
commit
d135373beb
1 changed files with 26 additions and 0 deletions
|
@ -3222,6 +3222,32 @@ gst_flv_demux_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
|||
}
|
||||
break;
|
||||
}
|
||||
case GST_QUERY_SEGMENT:
|
||||
{
|
||||
GstFormat format;
|
||||
gint64 start, stop;
|
||||
|
||||
format = demux->segment.format;
|
||||
|
||||
start =
|
||||
gst_segment_to_stream_time (&demux->segment, format,
|
||||
demux->segment.start);
|
||||
if ((stop = demux->segment.stop) == -1)
|
||||
stop = demux->segment.duration;
|
||||
else
|
||||
stop = gst_segment_to_stream_time (&demux->segment, format, stop);
|
||||
|
||||
if (demux->segment.rate < 0.0) {
|
||||
gint64 tmp;
|
||||
tmp = stop;
|
||||
stop = start;
|
||||
start = tmp;
|
||||
}
|
||||
|
||||
gst_query_set_segment (query, demux->segment.rate, format, start, stop);
|
||||
res = TRUE;
|
||||
break;
|
||||
}
|
||||
case GST_QUERY_LATENCY:
|
||||
default:
|
||||
res = gst_pad_query_default (pad, parent, query);
|
||||
|
|
Loading…
Reference in a new issue