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

Stefano Sabatini stefasab at gmail.com
Tue Apr 10 16:39:57 CEST 2012


On date Saturday 2012-04-07 10:30:53 +0200, Clément Bœsch encoded:
> 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?

I'm not sure, what if we have palette with more than 8 bits per
component?  Then maybe we should call it AV_PAL8_PALETTE_SIZE.

Anyway this is unrelated, so I'll apply the patch in a few days if I
read no comments.
-- 
FFmpeg = Furious & Fantastic Magic Portable Extroverse Governor


More information about the ffmpeg-devel mailing list