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 37e679881d
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:

committed by
Michael Niedermayer

parent
3ea101b234
commit
ffb4362bf0
@@ -102,6 +102,7 @@ typedef struct NUTContext {
|
||||
unsigned int max_distance;
|
||||
unsigned int time_base_count;
|
||||
int64_t last_syncpoint_pos;
|
||||
int64_t last_resync_pos;
|
||||
int header_count;
|
||||
AVRational *time_base;
|
||||
struct AVTreeNode *syncpoints;
|
||||
|
Reference in New Issue
Block a user