avcodec/h264: Only recover from reference pictures
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 26 Apr 2016 23:33:25 +0000 (01:33 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 26 Apr 2016 23:33:25 +0000 (01:33 +0200)
Fixes spec compliance
Fixes Ticket5346

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/h264.c

index 22375aa..a85953e 100644 (file)
@@ -1472,7 +1472,7 @@ again:
                     (h->nal_unit_type == NAL_IDR_SLICE);
 
                 if (h->nal_unit_type == NAL_IDR_SLICE ||
-                    h->recovery_frame == h->frame_num) {
+                    (h->recovery_frame == h->frame_num && h->nal_ref_idc)) {
                     h->recovery_frame         = -1;
                     h->cur_pic_ptr->recovered = 1;
                 }