diff options
author | Aurélien Zanelli <aurelien.zanelli@parrot.com> | 2015-03-16 16:20:44 +0100 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2018-05-04 22:59:26 +1000 |
commit | 89a85732d4d91ea6b41e3ea85fdf96152bc58e8d (patch) | |
tree | c8645356f43d19cc14fd79b2106bbe616abd7f8e /gst/mpegtsdemux | |
parent | 1b6cc98aa5a7a16e5662d71d5f7a911249c49abc (diff) | |
download | gstreamer-plugins-bad-89a85732d4d91ea6b41e3ea85fdf96152bc58e8d.tar.gz |
tsdemux: ignore sparse stream when checking for initial timestamp
Unless we only have sparse streams. In this case we will consider them.
It fixes a bug happening when first observed timestamp comes from a
sparse stream and other streams don't have a valid timestamp, yet. Thus
leading the timestamp from sparse stream to be the start of the
following segment. In this case, if the timestamp is really bigger than
non-sparse stream (audio/video), it will lead the pipeline to clip
samples from the non-parse stream.
https://bugzilla.gnome.org/show_bug.cgi?id=744469
Diffstat (limited to 'gst/mpegtsdemux')
-rw-r--r-- | gst/mpegtsdemux/tsdemux.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index b0ff238ea..40f06e367 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -2119,15 +2119,28 @@ check_pending_buffers (GstTSDemux * demux) /* The biggest offset */ guint64 offset = 0; GList *tmp; + gboolean have_only_sparse = TRUE; + + /* 0. Do we only have sparse stream */ + for (tmp = demux->program->stream_list; tmp; tmp = tmp->next) { + TSDemuxStream *tmpstream = (TSDemuxStream *) tmp->data; + + if (!tmpstream->sparse) { + have_only_sparse = FALSE; + break; + } + } /* 1. Go over all streams */ for (tmp = demux->program->stream_list; tmp; tmp = tmp->next) { TSDemuxStream *tmpstream = (TSDemuxStream *) tmp->data; /* 1.1 check if at least one stream got a valid DTS */ - if ((tmpstream->raw_dts != -1 && tmpstream->dts != GST_CLOCK_TIME_NONE) || - (tmpstream->raw_pts != -1 && tmpstream->pts != GST_CLOCK_TIME_NONE)) { - have_observation = TRUE; - break; + if (have_only_sparse || !tmpstream->sparse) { + if ((tmpstream->raw_dts != -1 && tmpstream->dts != GST_CLOCK_TIME_NONE) || + (tmpstream->raw_pts != -1 && tmpstream->pts != GST_CLOCK_TIME_NONE)) { + have_observation = TRUE; + break; + } } } |