summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-24 12:17:24 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-24 12:17:24 +0200
commit35075dc65041899eb6049dc80095b3f26847469e (patch)
treeb6b7363add0c8a1f3a4fe121b5e709cd2050ab4d /libavcodec/h264.c
parent63f0708478e11713ca405ac3d4fa59c62ab210cc (diff)
h264: Calculate a tighter recovery_frame.
Reduces delay with mplayers TS demuxer. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c3
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);
}