[FFmpeg-cvslog] h264: merge old and new "slice in extradata" checks

Michael Niedermayer git at videolan.org
Tue Dec 18 14:58:55 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Dec 18 14:50:12 2012 +0100| [99321d1b03b1724011101bf3c1d12beeb406b375] | committer: Michael Niedermayer

h264: merge old and new "slice in extradata" checks

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=99321d1b03b1724011101bf3c1d12beeb406b375
---

 libavcodec/h264.c |   20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 750229f..c652847 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3924,20 +3924,10 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
                 continue;
 
 again:
-            /* Ignore every NAL unit type except PPS and SPS during extradata
+            /* Ignore per frame NAL unit type during extradata
              * parsing. Decoding slices is not possible in codec init
              * with frame-mt */
-            if (parse_extradata && HAVE_THREADS &&
-                (s->avctx->active_thread_type & FF_THREAD_FRAME) &&
-                (hx->nal_unit_type != NAL_PPS &&
-                 hx->nal_unit_type != NAL_SPS)) {
-                av_log(avctx, AV_LOG_INFO, "Ignoring NAL unit %d during "
-                       "extradata parsing\n", hx->nal_unit_type);
-                hx->nal_unit_type = NAL_FF_IGNORE;
-            }
-            err = 0;
-
-            if (h->decoding_extradata) {
+            if (parse_extradata) {
                 switch (hx->nal_unit_type) {
                 case NAL_IDR_SLICE:
                 case NAL_SLICE:
@@ -3945,11 +3935,13 @@ again:
                 case NAL_DPB:
                 case NAL_DPC:
                 case NAL_AUXILIARY_SLICE:
-                    av_log(h->s.avctx, AV_LOG_WARNING, "Ignoring NAL %d in global header\n", hx->nal_unit_type);
-                    hx->nal_unit_type = NAL_FILLER_DATA;
+                    av_log(h->s.avctx, AV_LOG_WARNING, "Ignoring NAL %d in global header/extradata\n", hx->nal_unit_type);
+                    hx->nal_unit_type = NAL_FF_IGNORE;
                 }
             }
 
+            err = 0;
+
             switch (hx->nal_unit_type) {
             case NAL_IDR_SLICE:
                 if (first_slice != NAL_IDR_SLICE) {



More information about the ffmpeg-cvslog mailing list