ffmpeg/libavformat
Marton Balint 6ec009f7e2 avformat/mpegts: use get_packet_size in mpegts_resync for determining raw_packet_size
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...
2020-05-27 22:36:53 +02:00
..
tests avformat/url: check url root node when rel include double dot and trim double dot 2020-05-06 12:00:26 +08:00
.gitignore
3dostr.c
4xm.c
a64.c
aacdec.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
aadec.c avformat/aadec: Check toc_size to contain the minimum to demuxer uses 2020-05-21 09:31:08 +02:00
ac3dec.c
acm.c
act.c
adp.c
ads.c
adtsenc.c
adxdec.c
aea.c
afc.c
aiff.h
aiffdec.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
aiffenc.c avformat/aiffenc: Don't forget chapters 2020-05-25 05:38:15 +02:00
aixdec.c
allformats.c avformat: add demuxer for Pro Pinball Series' Soundbanks 2020-05-05 20:07:19 +02:00
alp.c
amr.c avformat/amr: Don't reimplement ff_raw_write_packet() 2020-04-14 18:52:44 +02:00
anm.c
apc.c
ape.c
apetag.c
apetag.h
apm.c
apngdec.c
apngenc.c
aptxdec.c
aqtitledec.c
argo_asf.c
asf.c
asf.h
asfcrypt.c
asfcrypt.h
asfdec_f.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
asfdec_o.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
asfenc.c
assdec.c
assenc.c
ast.c
ast.h
astdec.c
astenc.c
async.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
au.c
av1.c
av1.h
av1dec.c
avc.c
avc.h
avformat.h avformat/avformat: Remove redundant "NOT PART OF PUBLIC API" 2020-05-23 01:40:05 +02:00
avformatres.rc
avi.h
avidec.c
avienc.c
avio_internal.h
avio.c
avio.h
aviobuf.c avformat/aviobuf, nutenc: Move ff_puv_v, ff_get_v_length to nutenc.c 2020-05-05 19:28:28 +02:00
avisynth.c
avlanguage.c
avlanguage.h
avr.c
avs.c
bethsoftvid.c
bfi.c
bink.c
bintext.c
bit.c
bluray.c
bmv.c
boadec.c
brstm.c
c93.c
cache.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
caf.c
caf.h
cafdec.c
cafenc.c
cavsvideodec.c
cdg.c
cdxl.c
chromaprint.c
cinedec.c
codec2.c
concat.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
concatdec.c
crcenc.c
crypto.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
cutils.c
dash.c
dash.h
dashdec.c avformat/dashdec: compute the segment size use current pos minus offset plus one 2020-05-07 19:33:35 +08:00
dashenc.c avformat/dashenc: remove the arbitrary restrictions for filename 2020-05-01 22:57:29 +08:00
data_uri.c
dauddec.c
daudenc.c
davs2.c
dcstr.c
derf.c
dfa.c
dhav.c
diracdec.c
dnxhddec.c
dsfdec.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
dsicin.c
dss.c
dtsdec.c
dtshddec.c
dump.c avformat/dump: Use int64_t for intermediate time values 2020-05-17 13:03:30 +01:00
dv.c
dv.h
dvbsub.c
dvbtxt.c
dvenc.c
dxa.c
eacdata.c
electronicarts.c
epafdec.c
ffmeta.h
ffmetadec.c
ffmetaenc.c
fifo_test.c
fifo.c
file_open.c
file.c
filmstripdec.c
filmstripenc.c avformat/filmstripenc: Use ff_raw_write_packet() 2020-04-14 19:01:27 +02:00
fitsdec.c
fitsenc.c
flac_picture.c libavformat/flacdec: Workaround for truncated metadata picture size 2020-05-25 11:59:45 +02:00
flac_picture.h libavformat/flacdec: Workaround for truncated metadata picture size 2020-05-25 11:59:45 +02:00
flacdec.c libavformat/flacdec: Workaround for truncated metadata picture size 2020-05-25 11:59:45 +02:00
flacenc_header.c
flacenc.c avformat/vorbiscomment: Switch to AVIOContext from bytestream API 2020-05-03 13:43:54 +02:00
flacenc.h
flic.c
flv.h
flvdec.c
flvenc.c
format.c
framecrcenc.c
framehash.c
frmdec.c
fsb.c
ftp.c avformat/ftp: Fix for invalid use of av_strtok 2020-05-10 22:32:34 +08:00
fwse.c
g722.c
g723_1.c
g726.c
g729dec.c
gdv.c
genh.c
gif.c
gifdec.c
golomb_tab.c
gopher.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
gsmdec.c
gxf.c
gxf.h
gxfenc.c avformat: implement retiming directly in mxfenc and gxfenc 2020-05-07 23:12:24 +02:00
h261dec.c
h263dec.c
h264dec.c
hashenc.c
hca.c
hcom.c
hdsenc.c avformat/hdsenc: Add explicit deinit function 2020-04-30 08:24:09 +02:00
hevc.c
hevc.h
hevcdec.c
hls.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
hlsenc.c avformat/hlsenc: Don't segfault on uncommon names 2020-05-17 22:55:18 +02:00
hlsplaylist.c
hlsplaylist.h
hlsproto.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
hnm.c
http.c avformat/http: increase BUFFER_SIZE to MAX_URL_SIZE + HTTP_HEADERS_SIZE 2020-05-21 22:45:21 +02:00
http.h
httpauth.c
httpauth.h
icecast.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
icodec.c
icoenc.c
id3v1.c
id3v1.h
id3v2.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
id3v2.h avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
id3v2enc.c
idcin.c
idroqdec.c
idroqenc.c
iff.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
ifv.c
ilbc.c
img2_alias_pix.c
img2_brender_pix.c
img2.c
img2.h
img2dec.c
img2enc.c
ingenientdec.c
internal.h avformat/mux: Set AV_PKT_FLAG_KEY for is_intra_only packet 2020-05-07 07:12:24 +08:00
ip.c
ip.h
ipmovie.c
ircam.c
ircam.h
ircamdec.c
ircamenc.c
isom.c avcodec: add NotchLC decoder 2020-05-19 20:09:25 +02:00
isom.h
iss.c
iv8.c
ivfdec.c
ivfenc.c avformat/ivfenc: move bsf insertion to the init function 2020-05-11 19:41:59 -03:00
jacosubdec.c
jacosubenc.c
jvdec.c
kvag.c
latmenc.c
libamqp.c
libavformat.v
libgme.c
libmodplug.c
libopenmpt.c
librtmp.c
libsmbclient.c
libsrt.c avformat/libsrt: change open_timeout to int64_t to avoid integer overflow 2020-05-03 05:28:33 +08:00
libssh.c
libzmq.c
lmlm4.c
loasdec.c
log2_tab.c
lrc.c
lrc.h
lrcdec.c
lrcenc.c
lvfdec.c
lxfdec.c
m4vdec.c
Makefile avformat: fix apm makefile dependency 2020-05-27 17:10:30 +02:00
matroska.c avformat/matroska: Move mime_tag lists to matroskadec 2020-04-20 21:24:18 +02:00
matroska.h avformat/matroska: Move mime_tag lists to matroskadec 2020-04-20 21:24:18 +02:00
matroskadec.c avformat/matroskadec: Beautify matroska_parse_laces() 2020-05-26 06:19:25 +02:00
matroskaenc.c avformat/matroskaenc: Forward errors from avpriv_split_xiph_headers() 2020-05-23 07:10:56 +02:00
md5proto.c
metadata.c
metadata.h
mgsts.c
microdvddec.c
microdvdenc.c
mj2kdec.c
mkvtimestamp_v2.c
mlpdec.c
mlvdec.c
mm.c
mmf.c
mms.c
mms.h
mmsh.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
mmst.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
mov_chan.c
mov_chan.h
mov_esds.c
mov.c avformat/mov: Free temp buffer upon negative sample_size error. 2020-05-20 15:47:22 +02:00
movenc.c movenc: Fix accidental leftover duplication from 1aec1fbcc5 2020-05-22 22:00:03 +03:00
movenc.h avformat/movenc: remove the write_clli mov flag 2020-04-13 10:37:45 -06:00
movenccenc.c
movenccenc.h
movenchint.c
mp3dec.c lavf/mp3dec: don't adjust start time; packets are not adjusted. 2020-05-27 10:22:17 +02:00
mp3enc.c lavf/mp3enc: fix ID3v1 year metadata setting issue 2020-04-29 15:14:17 +08:00
mpc8.c
mpc.c avformat/mpc: Simplify cleanup 2020-04-19 02:37:46 +02:00
mpeg.c avformat/mpeg: Decrease score by 1 for files with very little valid data 2020-05-10 01:09:13 +02:00
mpeg.h
mpegenc.c avformat/mpegenc: Fix integer overflow with AV_NOPTS_VALUE 2020-05-21 09:31:08 +02:00
mpegts.c avformat/mpegts: use get_packet_size in mpegts_resync for determining raw_packet_size 2020-05-27 22:36:53 +02:00
mpegts.h avformat/mpegtsenc: use standard pids for m2ts 2020-04-21 21:28:29 +02:00
mpegtsenc.c avformat/mpegtsenc: cosmetic 2020-05-27 21:14:27 +08:00
mpegvideodec.c
mpjpeg.c
mpjpegdec.c
mpl2dec.c
mpsubdec.c
msf.c
msnwc_tcp.c
mtaf.c
mtv.c
musx.c
mux.c avformat/mux: Remove unnecessary unreferencing of AVPacket 2020-05-23 05:43:42 +02:00
mvdec.c
mvi.c
mxf.c
mxf.h
mxfdec.c avformat/mxfdec: reindent code 2020-05-05 08:20:45 +08:00
mxfenc.c avformat: implement retiming directly in mxfenc and gxfenc 2020-05-07 23:12:24 +02:00
mxg.c
ncdec.c
network.c
network.h
nistspheredec.c
nspdec.c
nsvdec.c
nullenc.c
nut.c
nut.h
nutdec.c
nutenc.c avformat/nutenc: Write size into right dynamic buffer 2020-05-05 19:35:38 +02:00
nuv.c
oggdec.c oggdec: remove the oggparsedaala subdemuxer 2020-05-23 19:07:20 +01:00
oggdec.h oggdec: remove the oggparsedaala subdemuxer 2020-05-23 19:07:20 +01:00
oggenc.c avformat/oggenc: Avoid allocating and copying when writing page data 2020-05-09 16:18:39 +02:00
oggparsecelt.c
oggparsedirac.c
oggparseflac.c
oggparseogm.c
oggparseopus.c oggdec: add support for proper demuxing of chained Opus files and streams 2020-04-30 23:05:51 +01:00
oggparseskeleton.c
oggparsespeex.c
oggparsetheora.c
oggparsevorbis.c avformat/oggparsevorbis: Error out on double init of vp 2020-05-26 00:45:27 +02:00
oggparsevp8.c
oma.c
oma.h
omadec.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
omaenc.c
options_table.h
options.c
os_support.c
os_support.h
paf.c
pcm.c
pcm.h
pcmdec.c
pcmenc.c
pjsdec.c
pmpdec.c
pp_bnk.c avformat: add demuxer for Pro Pinball Series' Soundbanks 2020-05-05 20:07:19 +02:00
prompeg.c
protocols.c
psxstr.c
pva.c
pvfdec.c
qcp.c
qtpalette.c
qtpalette.h
r3d.c avformat/r3d: Remove write-only array 2020-04-23 20:09:38 +02:00
rawdec.c
rawdec.h
rawenc.c
rawenc.h
rawutils.c
rawvideodec.c
rdt.c
rdt.h
realtextdec.c
redspark.c
replaygain.c
replaygain.h
riff.c avcodec: add NotchLC decoder 2020-05-19 20:09:25 +02:00
riff.h
riffdec.c
riffenc.c
rl2.c
rm.c
rm.h
rmdec.c
rmenc.c
rmsipr.c
rmsipr.h
rpl.c
rsd.c
rso.c
rso.h
rsodec.c
rsoenc.c avformat/rso: Don't reimplement ff_raw_write_packet() 2020-04-14 18:57:59 +02:00
rtmp.h
rtmpcrypt.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
rtmpcrypt.h
rtmpdh.c
rtmpdh.h
rtmpdigest.c
rtmphttp.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
rtmppkt.c
rtmppkt.h
rtmpproto.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
rtp.c
rtp.h
rtpdec_ac3.c
rtpdec_amr.c
rtpdec_asf.c
rtpdec_dv.c
rtpdec_formats.h
rtpdec_g726.c
rtpdec_h261.c
rtpdec_h263_rfc2190.c
rtpdec_h263.c
rtpdec_h264.c
rtpdec_hevc.c
rtpdec_ilbc.c
rtpdec_jpeg.c
rtpdec_latm.c
rtpdec_mpa_robust.c
rtpdec_mpeg4.c
rtpdec_mpeg12.c
rtpdec_mpegts.c
rtpdec_qcelp.c
rtpdec_qdm2.c
rtpdec_qt.c
rtpdec_rfc4175.c
rtpdec_svq3.c
rtpdec_vc2hq.c
rtpdec_vp8.c
rtpdec_vp9.c
rtpdec_xiph.c
rtpdec.c
rtpdec.h
rtpenc_aac.c
rtpenc_amr.c
rtpenc_chain.c
rtpenc_chain.h
rtpenc_h261.c
rtpenc_h263_rfc2190.c
rtpenc_h263.c
rtpenc_h264_hevc.c
rtpenc_jpeg.c
rtpenc_latm.c
rtpenc_mpegts.c
rtpenc_mpv.c
rtpenc_vc2hq.c
rtpenc_vp8.c
rtpenc_vp9.c
rtpenc_xiph.c
rtpenc.c
rtpenc.h
rtpproto.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
rtpproto.h
rtsp.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
rtsp.h
rtspcodes.h
rtspdec.c
rtspenc.c
s337m.c
samidec.c
sapdec.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
sapenc.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
sauce.c
sauce.h
sbcdec.c
sbgdec.c
sccdec.c
sccenc.c
sctp.c
sdp.c
sdr2.c
sdsdec.c
sdxdec.c
segafilm.c
segafilmenc.c
segment.c avformat/segment: Propagate disposition 2020-05-23 07:06:54 +02:00
serdec.c
shortendec.c
sierravmd.c
siff.c
smacker.c
smjpeg.c
smjpeg.h
smjpegdec.c
smjpegenc.c
smoothstreamingenc.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
smush.c
sol.c
sox.h
soxdec.c
soxenc.c
spdif.c
spdif.h
spdifdec.c
spdifenc.c
srtdec.c
srtenc.c
srtp.c
srtp.h
srtpproto.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
stldec.c
subfile.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
subtitles.c
subtitles.h
subviewer1dec.c
subviewerdec.c
supdec.c
supenc.c
svag.c
swf.c
swf.h
swfdec.c
swfenc.c avformat/swfenc: Fix integer overflow in frame rate handling 2020-05-21 09:31:08 +02:00
takdec.c
tcp.c
tedcaptionsdec.c
tee_common.c
tee_common.h
tee.c
teeproto.c
thp.c avformat/thp: Require a video stream 2020-05-10 01:09:13 +02:00
tiertexseq.c
tls_gnutls.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
tls_libtls.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
tls_mbedtls.c lavf/tls_mbedtls: fix resource leak 2020-04-22 12:41:29 +08:00
tls_openssl.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
tls_schannel.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
tls_securetransport.c avformat: Replace ffurl_close() by ffurl_closep() where appropriate 2020-05-25 13:11:36 +02:00
tls.c
tls.h
tmv.c
tta.c
ttaenc.c avformat/ttaenc: Defer freeing dynamic buffer 2020-05-21 05:30:26 +02:00
tty.c
txd.c
ty.c
udp.c
uncodedframecrcenc.c
unix.c
url.c avformat/url: check the result of the strrchr 2020-05-19 14:22:34 +08:00
url.h
urldecode.c
urldecode.h
utils.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
v210.c
vag.c
vapoursynth.c
vc1dec.c
vc1test.c
vc1testenc.c
version.h avformat: add demuxer for Pro Pinball Series' Soundbanks 2020-05-05 20:07:19 +02:00
vividas.c avformat/vividas: simplify, use av_rescale_q() instead 2020-05-10 22:32:33 +08:00
vivo.c
voc_packet.c
voc.c
voc.h
vocdec.c
vocenc.c
vorbiscomment.c avformat/vorbiscomment: Switch to AVIOContext from bytestream API 2020-05-03 13:43:54 +02:00
vorbiscomment.h avformat/vorbiscomment: Switch to AVIOContext from bytestream API 2020-05-03 13:43:54 +02:00
vpcc.c
vpcc.h
vpk.c
vplayerdec.c
vqf.c
w64.c
w64.h
wavdec.c avformat/id3v2: Remove unnecessary indirection 2020-05-25 07:06:44 +02:00
wavenc.c avformat/wavenc: simplify, use av_rescale_q() instead 2020-05-10 22:32:34 +08:00
wc3movie.c
webm_chunk.c avformat/webm_chunk: Open AVIOContext before initializing sub-muxer 2020-05-23 07:15:35 +02:00
webmdashenc.c avformat/webmdashenc: Simplify parsing strings 2020-05-23 06:41:50 +02:00
webpenc.c
webvttdec.c avformat/webvttdec: Remove write-only variable 2020-04-23 20:09:38 +02:00
webvttenc.c
westwood_aud.c
westwood_vqa.c
wsddec.c
wtv_common.c
wtv.h
wtvdec.c
wtvenc.c
wv.c
wv.h
wvdec.c
wvedec.c
wvenc.c
xa.c
xmv.c
xvag.c
xwma.c
yop.c
yuv4mpeg.h
yuv4mpegdec.c
yuv4mpegenc.c