wavparse: Implement SEGMENT query

https://bugzilla.gnome.org/show_bug.cgi?id=797313
This commit is contained in:
Sebastian Dröge 2018-10-23 09:42:21 +01:00
parent 486044063a
commit 2415d517f1

View file

@ -2748,6 +2748,25 @@ gst_wavparse_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
} }
break; break;
} }
case GST_QUERY_SEGMENT:
{
GstFormat format;
gint64 start, stop;
format = wav->segment.format;
start =
gst_segment_to_stream_time (&wav->segment, format,
wav->segment.start);
if ((stop = wav->segment.stop) == -1)
stop = wav->segment.duration;
else
stop = gst_segment_to_stream_time (&wav->segment, format, stop);
gst_query_set_segment (query, wav->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;