Commit d73cbc22 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b4429c25
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment