[FFmpeg-devel] [PATCH] lavfi: copy palette in start_frame()

Stefano Sabatini stefasab at gmail.com
Sat Apr 7 10:03:04 CEST 2012


Fix -vf copy with pal8 format.
---
 libavfilter/avfilter.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 141fb9d..edf19dc 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -588,6 +588,10 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
         link->cur_buf = avfilter_get_video_buffer(link, dst->min_perms, link->w, link->h);
         link->src_buf = picref;
         avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
+
+        /* copy palette if required */
+        if (link->format == PIX_FMT_PAL8)
+            memcpy(link->cur_buf->data[1], link->src_buf-> data[1], 256*4);
     }
     else
         link->cur_buf = picref;
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list