• Marton Balint's avatar
    avformat/mpegts: use get_packet_size in mpegts_resync for determining raw_packet_size · 6ec009f7
    Marton Balint authored
    The old resync logic had some bugs, for example the packet size could stuck
    into 192 bytes, because pos47_full was not updated for every packet, and for
    unseekable inputs the resync logic simply skipped some 0x47 sync bytes,
    therefore the calculated distance between sync bytes was a multiple of 188
    bytes.
    
    AVIO only buffers a single packet (for UDP/mpegts, that usually means 1316
    bytes), so for every ten consecutive 188-byte MPEGTS packets there was always a
    seek failure, and that caused the old code to not find the 188 byte pattern
    across 10 consecutive packets.
    
    This patch changes the custom logic to the one which is used when probing to
    determine the packet size. This was already proposed as a FIXME a long time
    ago...
    6ec009f7
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...