diff options
author | Edward Hervey <edward@centricular.com> | 2018-06-12 11:14:25 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2018-06-19 07:03:27 +0200 |
commit | c8fb638094f6a5bc9f4d016f83248bc253a1050b (patch) | |
tree | 22df5dfa9f9b8907810ab925bcbc5f8b5baa7f87 | |
parent | 281bb0da3a75ae08173b3badf1d98b2036a90557 (diff) | |
download | gstreamer-plugins-bad-c8fb638094f6a5bc9f4d016f83248bc253a1050b.tar.gz |
tsdemux: Don't query duration if program isn't active
-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 */ |