[vlc-commits] avcodec: keep the palette when updating the format

Thomas Guillem git at videolan.org
Tue Sep 27 09:01:44 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Sep 27 08:57:50 2016 +0200| [57731a60c944fc65873f457ae71c1e3194ac1fc1] | committer: Thomas Guillem

avcodec: keep the palette when updating the format

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=57731a60c944fc65873f457ae71c1e3194ac1fc1
---

 modules/codec/avcodec/video.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 5c5e84d..7aa1872 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -283,6 +283,9 @@ static int lavc_UpdateVideoFormat(decoder_t *dec, AVCodecContext *ctx,
     if (val)
         return val;
 
+    fmt_out.p_palette = dec->fmt_out.video.p_palette;
+    dec->fmt_out.video.p_palette = NULL;
+
     es_format_Clean(&dec->fmt_out);
     es_format_Init(&dec->fmt_out, VIDEO_ES, fmt_out.i_chroma);
     dec->fmt_out.video = fmt_out;



More information about the vlc-commits mailing list