mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
mpegdemux: Set duration on seeking query if possible
Set duration on seeking query in the same way as duration query handler. Otherwise application might get confused as if the duration is unknown. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1791>
This commit is contained in:
parent
6d300ce785
commit
7cec64499d
1 changed files with 7 additions and 3 deletions
|
@ -1557,10 +1557,14 @@ gst_ps_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
||||||
if (demux->random_access) {
|
if (demux->random_access) {
|
||||||
/* In pull mode we can seek in TIME format if we have the SCR */
|
/* In pull mode we can seek in TIME format if we have the SCR */
|
||||||
if (fmt != GST_FORMAT_TIME || demux->scr_rate_n == G_MAXUINT64
|
if (fmt != GST_FORMAT_TIME || demux->scr_rate_n == G_MAXUINT64
|
||||||
|| demux->scr_rate_d == G_MAXUINT64)
|
|| demux->scr_rate_d == G_MAXUINT64) {
|
||||||
gst_query_set_seeking (query, fmt, FALSE, -1, -1);
|
gst_query_set_seeking (query, fmt, FALSE, -1, -1);
|
||||||
else
|
} else {
|
||||||
gst_query_set_seeking (query, fmt, TRUE, 0, -1);
|
gint64 dur = -1;
|
||||||
|
if (GST_CLOCK_TIME_IS_VALID (demux->src_segment.duration))
|
||||||
|
dur = demux->src_segment.duration;
|
||||||
|
gst_query_set_seeking (query, fmt, TRUE, 0, dur);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (fmt == GST_FORMAT_BYTES) {
|
if (fmt == GST_FORMAT_BYTES) {
|
||||||
/* Seeking in BYTES format not supported at all */
|
/* Seeking in BYTES format not supported at all */
|
||||||
|
|
Loading…
Reference in a new issue