mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 07:08:23 +00:00
splitmuxsrc: don't respond to duration query with CLOCK_TIME_NONE
total_duration is initialised to CLOCK_TIME_NONE, not 0, so check for that as well in order not to return an invalid duration to a duration query. Doesn't fix anything particular observed in practice, just seemed inconsistent.
This commit is contained in:
parent
ac46d5c2a3
commit
07ae64118d
1 changed files with 7 additions and 4 deletions
|
@ -1211,18 +1211,21 @@ splitmux_src_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
|||
break;
|
||||
}
|
||||
case GST_QUERY_DURATION:{
|
||||
GstClockTime duration;
|
||||
GstFormat fmt;
|
||||
|
||||
gst_query_parse_duration (query, &fmt, NULL);
|
||||
if (fmt != GST_FORMAT_TIME)
|
||||
break;
|
||||
|
||||
GST_OBJECT_LOCK (splitmux);
|
||||
if (splitmux->total_duration > 0) {
|
||||
gst_query_set_duration (query, GST_FORMAT_TIME,
|
||||
splitmux->total_duration);
|
||||
duration = splitmux->total_duration;
|
||||
GST_OBJECT_UNLOCK (splitmux);
|
||||
|
||||
if (duration > 0 && duration != GST_CLOCK_TIME_NONE) {
|
||||
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
|
||||
ret = TRUE;
|
||||
}
|
||||
GST_OBJECT_UNLOCK (splitmux);
|
||||
break;
|
||||
}
|
||||
case GST_QUERY_SEEKING:{
|
||||
|
|
Loading…
Reference in a new issue