diff options
author | Andreas Cadhalpun <[email protected]> | 2015-05-20 00:06:05 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2015-05-23 00:55:57 +0200 |
commit | ffb4362bf0b6e6cd6a87b6479177f599419dfb8c (patch) | |
tree | bfc26b4d9b0562e9ca01b89da9860e045ce04286 /libavformat/nut.h | |
parent | 3ea101b234485d43c0f538d77b208311aec4023b (diff) |
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 <[email protected]>
Signed-off-by: Andreas Cadhalpun <[email protected]>
(cherry picked from commit 37e679881d364b6da817d829d35869d657218ab3)
Signed-off-by: Michael Niedermayer <[email protected]>
Diffstat (limited to 'libavformat/nut.h')
-rw-r--r-- | libavformat/nut.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/nut.h b/libavformat/nut.h index 943081caf6..0c678a51b9 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -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; |