diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-01 20:20:07 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-01 22:01:34 +0100 |
commit | 0126cd95ccc37aa327e8eff6e4f58dda4f861adf (patch) | |
tree | 0681509c6799c300816e1d6e46e3f15a8243b823 | |
parent | 71ca855c9d61ed4b3c1e22ac4d713730287d40cd (diff) | |
download | ffmpeg-0126cd95ccc37aa327e8eff6e4f58dda4f861adf.tar.gz |
avcodec/ituh263dec: Correct timestamp recovery for B frames
Improves u263_b-frames_5.avi
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/ituh263dec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index 4a8bbf7798..31951abd65 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -928,8 +928,9 @@ int ff_h263_decode_picture_header(MpegEncContext *s) } /* temporal reference */ i = get_bits(&s->gb, 8); /* picture timestamp */ - if( (s->picture_number&~0xFF)+i < s->picture_number) - i+= 256; + + i -= (i - (s->picture_number & 0xFF) + 128) & ~0xFF; + s->picture_number= (s->picture_number&~0xFF) + i; /* PTYPE starts here */ |