We want to update it for all the thread contexts, not just the main one.
---
 libavcodec/h264_slice.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c834573..43832b4 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1014,6 +1014,8 @@ static int h264_slice_header_init(H264Context *h, int 
reinit)
 
     h->avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
     h->pixel_shift                = h->sps.bit_depth_luma > 8;
+    h->chroma_format_idc          = h->sps.chroma_format_idc;
+    h->bit_depth_luma             = h->sps.bit_depth_luma;
 
     ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma,
                     h->sps.chroma_format_idc);
@@ -1158,11 +1160,8 @@ int ff_h264_decode_slice_header(H264Context *h, 
H264SliceContext *sl)
         h->sps = *h->sps_buffers[h->pps.sps_id];
 
         if (h->bit_depth_luma    != h->sps.bit_depth_luma ||
-            h->chroma_format_idc != h->sps.chroma_format_idc) {
-            h->bit_depth_luma    = h->sps.bit_depth_luma;
-            h->chroma_format_idc = h->sps.chroma_format_idc;
+            h->chroma_format_idc != h->sps.chroma_format_idc)
             needs_reinit         = 1;
-        }
 
         if (h->flags & CODEC_FLAG_LOW_DELAY ||
             (h->sps.bitstream_restriction_flag &&
-- 
2.0.0

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to