[FFmpeg-cvslog] avcodec/h264: Be more tolerant to changing pps id between slices

Michael Niedermayer git at videolan.org
Thu Apr 16 16:16:55 CEST 2015


ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Thu Apr  9 13:50:07 2015 +0200| [82d3dd44aad41a12b37f8bbd01b893c7fa3e13c2] | committer: Michael Niedermayer

avcodec/h264: Be more tolerant to changing pps id between slices

Fixes Ticket4446

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 98d0c4236c7542c87f012228d3bc88aea67bddc2)

Conflicts:

	libavcodec/h264.c
(cherry picked from commit 0cd0fa9d0baabd2dc0442ed8b53ba65282733b61)

Conflicts:

	libavcodec/h264.c

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

 libavcodec/h264.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 92c9fbc..d2b88d1 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -5011,9 +5011,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
                 continue;
 
 again:
-            if (   (!(avctx->active_thread_type & FF_THREAD_FRAME) || nals_needed >= nal_index)
-                && !h->current_slice)
-                h->au_pps_id = -1;
             /* Ignore per frame NAL unit type during extradata
              * parsing. Decoding slices is not possible in codec init
              * with frame-mt */
@@ -5059,6 +5056,10 @@ again:
                 hx->inter_gb_ptr      = &hx->gb;
                 hx->data_partitioning = 0;
 
+                if (   nals_needed >= nal_index
+                    || (!(avctx->active_thread_type & FF_THREAD_FRAME) && !context_count))
+                    h->au_pps_id = -1;
+
                 if ((err = decode_slice_header(hx, h)))
                     break;
 



More information about the ffmpeg-cvslog mailing list