mpegtsbase: Split up whether we saw a PAT and its offset
Fixes the issue with streams that don't set an offset on their buffers, like those coming from hlsdemux. Fixes #653481
This commit is contained in:
parent
592d7cbc15
commit
a82483e367
@ -239,6 +239,7 @@ mpegts_base_init (MpegTSBase * base, MpegTSBaseClass * klass)
|
|||||||
base->stream_size = sizeof (MpegTSBaseStream);
|
base->stream_size = sizeof (MpegTSBaseStream);
|
||||||
|
|
||||||
base->mode = BASE_MODE_STREAMING;
|
base->mode = BASE_MODE_STREAMING;
|
||||||
|
base->seen_pat = FALSE;
|
||||||
base->first_pat_offset = -1;
|
base->first_pat_offset = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,7 +706,7 @@ mpegts_base_apply_pmt (MpegTSBase * base,
|
|||||||
const GValue *value;
|
const GValue *value;
|
||||||
MpegTSBaseClass *klass = GST_MPEGTS_BASE_GET_CLASS (base);
|
MpegTSBaseClass *klass = GST_MPEGTS_BASE_GET_CLASS (base);
|
||||||
|
|
||||||
if (G_UNLIKELY (base->first_pat_offset == -1)) {
|
if (G_UNLIKELY (base->seen_pat == FALSE)) {
|
||||||
GST_WARNING ("Got pmt without pat first. Returning");
|
GST_WARNING ("Got pmt without pat first. Returning");
|
||||||
/* remove the stream since we won't get another PMT otherwise */
|
/* remove the stream since we won't get another PMT otherwise */
|
||||||
mpegts_packetizer_remove_stream (base->packetizer, pmt_pid);
|
mpegts_packetizer_remove_stream (base->packetizer, pmt_pid);
|
||||||
@ -832,7 +833,7 @@ mpegts_base_handle_psi (MpegTSBase * base, MpegTSPacketizerSection * section)
|
|||||||
structure = mpegts_packetizer_parse_pat (base->packetizer, section);
|
structure = mpegts_packetizer_parse_pat (base->packetizer, section);
|
||||||
if (G_LIKELY (structure)) {
|
if (G_LIKELY (structure)) {
|
||||||
mpegts_base_apply_pat (base, structure);
|
mpegts_base_apply_pat (base, structure);
|
||||||
if (base->first_pat_offset == -1) {
|
if (base->seen_pat == FALSE) {
|
||||||
|
|
||||||
base->first_pat_offset = GST_BUFFER_OFFSET (section->buffer);
|
base->first_pat_offset = GST_BUFFER_OFFSET (section->buffer);
|
||||||
GST_DEBUG ("First PAT offset: %" G_GUINT64_FORMAT,
|
GST_DEBUG ("First PAT offset: %" G_GUINT64_FORMAT,
|
||||||
|
@ -117,6 +117,9 @@ struct _MpegTSBase {
|
|||||||
* by subclasses if they have their own MpegTSBaseStream subclasses */
|
* by subclasses if they have their own MpegTSBaseStream subclasses */
|
||||||
gsize stream_size;
|
gsize stream_size;
|
||||||
|
|
||||||
|
/* Whether we saw a PAT yet */
|
||||||
|
gboolean seen_pat;
|
||||||
|
|
||||||
/*Offset from the origin to the first PAT (pullmode) */
|
/*Offset from the origin to the first PAT (pullmode) */
|
||||||
guint64 first_pat_offset;
|
guint64 first_pat_offset;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user