nutdec: fix infinite resync loops
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Tue, 19 May 2015 22:06:05 +0000 (00:06 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 1 Jun 2015 21:25:19 +0000 (23:25 +0200)
commit936a5dd2c5c9141bcc02c4bd6749e26f1e4454b2
treed7b57b0eef8fd0582661fcc2c10a500c35058417
parent236452f83e5d4de2187a3a71e91807a7a5bbf496
nutdec: fix infinite resync loops

nut->last_syncpoint_pos doesn't necessarily change between resync
attempts, so find_any_startcode can return the same startcode again.

Thus remember where the last resync happened and don't try to resync
before that.

This can't be done locally in nut_read_packet, because this wouldn't
prevent infinite resync loops, where after the resync a packet is
returned and while reading a following packet the resync happens again.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 37e679881d364b6da817d829d35869d657218ab3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/nut.h
libavformat/nutdec.c