h264: do not discard NAL_SEI when skipping frames
authorRainer Hochecker <fernetmenta@online.de>
Thu, 19 Sep 2013 14:26:24 +0000 (16:26 +0200)
committerAnton Khirnov <anton@khirnov.net>
Tue, 24 Sep 2013 11:24:29 +0000 (13:24 +0200)
Setting AVDISCARD_NONREF (e.g. after flushing) resulted in 100% dropped frames.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/h264.c

index 323d191..274c738 100644 (file)
@@ -4547,8 +4547,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
                 continue;
             }
 
-            // FIXME do not discard SEI id
-            if (avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc == 0)
+            if (avctx->skip_frame >= AVDISCARD_NONREF &&
+                h->nal_ref_idc == 0 &&
+                h->nal_unit_type != NAL_SEI)
                 continue;
 
 again: