mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-04 09:42:19 +00:00
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
This commit is contained in:
parent
1b6cc98aa5
commit
89a85732d4
1 changed files with 17 additions and 4 deletions
|
@ -2119,17 +2119,30 @@ check_pending_buffers (GstTSDemux * demux)
|
||||||
/* The biggest offset */
|
/* The biggest offset */
|
||||||
guint64 offset = 0;
|
guint64 offset = 0;
|
||||||
GList *tmp;
|
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 */
|
/* 1. Go over all streams */
|
||||||
for (tmp = demux->program->stream_list; tmp; tmp = tmp->next) {
|
for (tmp = demux->program->stream_list; tmp; tmp = tmp->next) {
|
||||||
TSDemuxStream *tmpstream = (TSDemuxStream *) tmp->data;
|
TSDemuxStream *tmpstream = (TSDemuxStream *) tmp->data;
|
||||||
/* 1.1 check if at least one stream got a valid DTS */
|
/* 1.1 check if at least one stream got a valid DTS */
|
||||||
|
if (have_only_sparse || !tmpstream->sparse) {
|
||||||
if ((tmpstream->raw_dts != -1 && tmpstream->dts != GST_CLOCK_TIME_NONE) ||
|
if ((tmpstream->raw_dts != -1 && tmpstream->dts != GST_CLOCK_TIME_NONE) ||
|
||||||
(tmpstream->raw_pts != -1 && tmpstream->pts != GST_CLOCK_TIME_NONE)) {
|
(tmpstream->raw_pts != -1 && tmpstream->pts != GST_CLOCK_TIME_NONE)) {
|
||||||
have_observation = TRUE;
|
have_observation = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* 2. If we don't have a valid value yet, break out */
|
/* 2. If we don't have a valid value yet, break out */
|
||||||
if (have_observation == FALSE)
|
if (have_observation == FALSE)
|
||||||
|
|
Loading…
Reference in a new issue