[vlc-commits] Revert "avcodec: remove useless palette copy"

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:46:45 2016 +0200| [5739c05fce6b16a70e77e037dada5f751831594c] | committer: Thomas Guillem

Revert "avcodec: remove useless palette copy"

Finally, we might need to setup the vout with the palette coming from fmt_in.

This reverts commit a944c74a0276e551a28f0979f69280efb0c3425e.

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

 modules/codec/avcodec/video.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 2708ca3..5c5e84d 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -528,9 +528,12 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
 
     p_dec->fmt_out.video.orientation = p_dec->fmt_in.video.orientation;
 
-    if( p_dec->fmt_in.video.p_palette )
+    if( p_dec->fmt_in.video.p_palette ) {
         p_sys->palette_sent = false;
-    else
+        p_dec->fmt_out.video.p_palette = malloc( sizeof(video_palette_t) );
+        if( p_dec->fmt_out.video.p_palette )
+            *p_dec->fmt_out.video.p_palette = *p_dec->fmt_in.video.p_palette;
+    } else
         p_sys->palette_sent = true;
 
     /* ***** init this codec with special data ***** */



More information about the vlc-commits mailing list