Merge commit 'e26c64148be8a20ace7512d96503172fb5e9753b'
authorTimothy Gu <timothygu99@gmail.com>
Thu, 4 Aug 2016 02:46:06 +0000 (19:46 -0700)
committerTimothy Gu <timothygu99@gmail.com>
Thu, 4 Aug 2016 02:50:06 +0000 (19:50 -0700)
* commit 'e26c64148be8a20ace7512d96503172fb5e9753b':
  h264: discard slices of redundant pictures right after parsing the slice header

Conflicts:
libavcodec/h264_slice.c
libavcodec/h264dec.c

TODO: fix indentation

Merged-by: Timothy Gu <timothygu99@gmail.com>
libavcodec/h264_slice.c
libavcodec/h264dec.c

index c2490cbd45bb187fa5356dd5cfaed295600bf32e..c6f40e59c599f90016edfab5ebe7e4495e2b188d 100644 (file)
@@ -1738,6 +1738,10 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl,
     if (ret < 0)
         return ret;
 
+    // discard redundant pictures
+    if (sl->redundant_pic_count > 0)
+        return 0;
+
     if (sl->first_mb_addr == 0 || !h->current_slice) {
         if (h->setup_finished) {
             av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
index 977977431e692b1b3751449927af6954ed04ecb5..c72a7fcc163327804ac52c9c0cbf8b09b6796558 100644 (file)
@@ -799,6 +799,9 @@ again:
             if ((err = ff_h264_decode_slice_header(h, sl, nal)))
                 break;
 
+            if (sl->redundant_pic_count > 0)
+                break;
+
             if (h->sei.recovery_point.recovery_frame_cnt >= 0) {
                 const int sei_recovery_frame_cnt = h->sei.recovery_point.recovery_frame_cnt;
 
@@ -845,7 +848,6 @@ again:
 #endif
             }
 
-            if (sl->redundant_pic_count == 0) {
                 if (avctx->hwaccel) {
                     ret = avctx->hwaccel->decode_slice(avctx,
                                                        nal->raw_data,
@@ -864,7 +866,6 @@ again:
 #endif
                 } else
                     context_count++;
-            }
             break;
         case H264_NAL_DPA:
         case H264_NAL_DPB: