tsdemux: Don't query duration if program isn't active

This commit is contained in:
Edward Hervey 2018-06-12 11:14:25 +02:00 committed by Edward Hervey
parent 0178354e6e
commit 4ae9a9dc91

View file

@ -496,6 +496,11 @@ gst_ts_demux_get_duration (GstTSDemux * demux, GstClockTime * dur)
gboolean res = FALSE;
gint64 val;
if (!demux->program) {
GST_DEBUG_OBJECT (demux, "No active program yet, can't provide duration");
return FALSE;
}
/* Get total size in bytes */
if (gst_pad_peer_query_duration (base->sinkpad, GST_FORMAT_BYTES, &val)) {
/* Convert it to duration */