mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-04 23:30:05 +00:00
tsdemux: More fixes to handle non-188 byte packets
This commit is contained in:
parent
6c0254b84b
commit
e1a7d71184
2 changed files with 13 additions and 0 deletions
|
@ -2268,6 +2268,14 @@ mpegts_packetizer_next_packet (MpegTSPacketizer2 * packetizer,
|
|||
gst_buffer_unref (packet->buffer);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (packetizer->packet_size == MPEGTS_M2TS_PACKETSIZE) {
|
||||
if (i >= 4)
|
||||
i -= 4;
|
||||
else
|
||||
i += 188;
|
||||
}
|
||||
|
||||
/* Pop out the remaining data... */
|
||||
GST_BUFFER_DATA (packet->buffer) += i;
|
||||
GST_BUFFER_SIZE (packet->buffer) -= i;
|
||||
|
|
|
@ -547,6 +547,9 @@ gst_ts_demux_perform_auxiliary_seek (MpegTSBase * base, GstClockTime seektime,
|
|||
|
||||
mpegts_packetizer_flush (base->packetizer);
|
||||
|
||||
if (base->packetizer->packet_size == MPEGTS_M2TS_PACKETSIZE)
|
||||
offset -= 4;
|
||||
|
||||
while (!done && scan_offset <= length) {
|
||||
res =
|
||||
gst_pad_pull_range (base->sinkpad, offset + scan_offset,
|
||||
|
@ -1519,6 +1522,8 @@ find_pcr_packet (MpegTSBase * base, guint64 offset, gint64 length,
|
|||
return GST_FLOW_ERROR;
|
||||
|
||||
mpegts_packetizer_flush (base->packetizer);
|
||||
if (offset >= 4 && base->packetizer->packet_size == MPEGTS_M2TS_PACKETSIZE)
|
||||
offset -= 4;
|
||||
|
||||
while (!done && scan_offset < length) {
|
||||
ret =
|
||||
|
|
Loading…
Reference in a new issue