summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2018-06-12 11:14:25 +0200
committerEdward Hervey <bilboed@bilboed.com>2018-06-12 11:14:51 +0200
commit4ae9a9dc918caaaa4bd2c8365e29071a3abd0ea4 (patch)
tree757802e0d3bb8a2b7b65b5e10b10bd5548553e51 /gst
parent0178354e6e8598ab14091103db832e23ee1bdfcc (diff)
tsdemux: Don't query duration if program isn't active
Diffstat (limited to 'gst')
-rw-r--r--gst/mpegtsdemux/tsdemux.c5
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 */