diff options
author | Edward Hervey <edward@centricular.com> | 2018-06-12 11:14:25 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2018-06-12 11:14:51 +0200 |
commit | 4ae9a9dc918caaaa4bd2c8365e29071a3abd0ea4 (patch) | |
tree | 757802e0d3bb8a2b7b65b5e10b10bd5548553e51 /gst | |
parent | 0178354e6e8598ab14091103db832e23ee1bdfcc (diff) |
tsdemux: Don't query duration if program isn't active
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpegtsdemux/tsdemux.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 1e1c0eab5..35c7f29ea 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -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 */ |