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:{