mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
asfdemux: Implement SEGMENT query
This commit is contained in:
parent
1803b3c185
commit
1ce9d7b2d1
1 changed files with 27 additions and 1 deletions
|
@ -2623,7 +2623,7 @@ gst_asf_demux_parse_stream_object (GstASFDemux * demux, guint8 * data,
|
||||||
|
|
||||||
flags = gst_asf_demux_get_uint16 (&data, &size);
|
flags = gst_asf_demux_get_uint16 (&data, &size);
|
||||||
stream_id = flags & 0x7f;
|
stream_id = flags & 0x7f;
|
||||||
is_encrypted = !!((flags & 0x8000) << 15);
|
is_encrypted = ! !((flags & 0x8000) << 15);
|
||||||
unknown = gst_asf_demux_get_uint32 (&data, &size);
|
unknown = gst_asf_demux_get_uint32 (&data, &size);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (demux, "Found stream %u, time_offset=%" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (demux, "Found stream %u, time_offset=%" GST_TIME_FORMAT,
|
||||||
|
@ -4297,6 +4297,32 @@ gst_asf_demux_handle_src_query (GstPad * pad, GstObject * parent,
|
||||||
gst_query_set_latency (query, live, min, max);
|
gst_query_set_latency (query, live, min, max);
|
||||||
break;
|
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;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
res = gst_pad_query_default (pad, parent, query);
|
res = gst_pad_query_default (pad, parent, query);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue