diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-18 22:59:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-18 22:59:04 +0200 |
commit | d73cbc22c5f2c305838d9867538cf4ad59c4035f (patch) | |
tree | 391a1d547611852ebd21846d993c31b2dbdbfc46 /libavformat/mpegts.c | |
parent | b4429c259a64b46357165e4eafaead175be44760 (diff) | |
download | ffmpeg-d73cbc22c5f2c305838d9867538cf4ad59c4035f.tar.gz |
avformat/mpegts: resync from the smallest packet size on
This avoids the loss of a packet in many cases if the packet size was wrong.
It also improves detection of packet size changes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r-- | libavformat/mpegts.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index db564b3d9b..c641794556 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1974,7 +1974,7 @@ static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size, co /* check packet sync byte */ if ((*data)[0] != 0x47) { /* find a new packet start */ - avio_seek(pb, -TS_PACKET_SIZE, SEEK_CUR); + avio_seek(pb, -raw_packet_size, SEEK_CUR); if (mpegts_resync(s) < 0) return AVERROR(EAGAIN); else |