summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2018-01-25 00:42:52 +0000
committerTim-Philipp Müller <tim@centricular.com>2018-01-29 11:29:24 +0000
commit07ae64118df86d7e5b711d5966b6dc35009e8473 (patch)
treea437f3399ac6234bf11d5333d0895f3e0073ad54
parentac46d5c2a33ff370b73acb87961e030a43b6239a (diff)
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.
-rw-r--r--gst/multifile/gstsplitmuxsrc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gst/multifile/gstsplitmuxsrc.c b/gst/multifile/gstsplitmuxsrc.c
index b27cf00c9..df8eba2bc 100644
--- a/gst/multifile/gstsplitmuxsrc.c
+++ b/gst/multifile/gstsplitmuxsrc.c
@@ -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:{