]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/flac_parser.c
h264: fix bit depth changes with frame threading
[ffmpeg] / libavcodec / flac_parser.c
index 6c8c04675c976d7fc944404884e54f1a353d145d..ee92ee3b0d8426e59a040023a4db5a1c0fb361bf 100644 (file)
@@ -457,8 +457,12 @@ static int get_best_header(FLACParseContext* fpc, const uint8_t **poutbuf,
         check_header_mismatch(fpc, header, child, 0);
     }
 
+    if (header->fi.channels != fpc->avctx->channels ||
+        !fpc->avctx->channel_layout) {
+        fpc->avctx->channels = header->fi.channels;
+        ff_flac_set_channel_layout(fpc->avctx);
+    }
     fpc->avctx->sample_rate = header->fi.samplerate;
-    fpc->avctx->channels    = header->fi.channels;
     fpc->pc->duration       = header->fi.blocksize;
     *poutbuf = flac_fifo_read_wrap(fpc, header->offset, *poutbuf_size,
                                         &fpc->wrap_buf,