aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorllyyr <llyyr.public@gmail.com>2024-05-27 18:52:31 +0530
committerHendrik Leppkes <h.leppkes@gmail.com>2024-12-08 10:54:26 +0100
commit550c662a1f94ddcd8d91f9874edc4b68d73fa7c7 (patch)
tree8dea2ba7651c57c232de74d672437afb77ecc097 /libavformat/movenc.c
parentc893dcce312af152f21a54874f88576ad279e722 (diff)
downloadffmpeg-550c662a1f94ddcd8d91f9874edc4b68d73fa7c7.tar.gz
avformat/mpegts: correctly skip TP_extra_header in m2ts
instead of just resyncing and skipping a bunch of TS packets, leading to a loss of frames. Before this, a stray byte with the value of 0x47 in TP_extra_header would throw off the detection of where TS packets start. A typical file that could cause issues would look like this: 00000300: 238f 4780 4750 1110 0000 01e0 0000 84c0 ^^ ^^ The first four bytes here are TP_extra_header and the actual TS packet starts at offset 0x304 FFmpeg would try to read a packet at 0x300 but since nothing skips the 4 byte TP_extra_header, find that the first byte is not 0x47 and immediately go into mpegts_resync, and incorrectly detect the stray 0x47 in the TP_extra_header at 0x302 as the new sync byte. Fix this by correctly skipping the first 4 bytes if the source packet is 192 bytes. Signed-off-by: llyyr <llyyr.public@gmail.com> Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat/movenc.c')
0 files changed, 0 insertions, 0 deletions