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

Clément Bœsch ubitux at gmail.com
Sat Apr 7 10:30:53 CEST 2012


On Sat, Apr 07, 2012 at 10:03:04AM +0200, Stefano Sabatini wrote:
> 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);

AVPALETTE_SIZE?

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120407/cb51eeba/attachment.asc>


More information about the ffmpeg-devel mailing list