diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-24 12:17:24 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-24 12:17:24 +0200 |
commit | 35075dc65041899eb6049dc80095b3f26847469e (patch) | |
tree | b6b7363add0c8a1f3a4fe121b5e709cd2050ab4d | |
parent | 63f0708478e11713ca405ac3d4fa59c62ab210cc (diff) | |
download | ffmpeg-35075dc65041899eb6049dc80095b3f26847469e.tar.gz |
h264: Calculate a tighter recovery_frame.
Reduces delay with mplayers TS demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index b353bee474..ce633eab13 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3863,7 +3863,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ if((err = decode_slice_header(hx, h))) break; - if (h->sei_recovery_frame_cnt >= 0 && h->recovery_frame < 0) { + if ( h->sei_recovery_frame_cnt >= 0 + && (h->recovery_frame - h->frame_num) & ((1 << h->sps.log2_max_frame_num)-1) > h->sei_recovery_frame_cnt) { h->recovery_frame = (h->frame_num + h->sei_recovery_frame_cnt) % (1 << h->sps.log2_max_frame_num); } |