lavfi: copy palette in start_frame()

Fix -vf copy with pal8 format.
pull/30/merge
Stefano Sabatini 13 years ago
parent f2ee065638
commit fce30d8d73
  1. 4
      libavfilter/video.c

@ -230,6 +230,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->cur_buf = avfilter_get_video_buffer(link, dst->min_perms, link->w, link->h);
link->src_buf = picref; link->src_buf = picref;
avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf); avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
/* copy palette if required */
if (av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PAL)
memcpy(link->cur_buf->data[1], link->src_buf-> data[1], AVPALETTE_SIZE);
} }
else else
link->cur_buf = picref; link->cur_buf = picref;

Loading…
Cancel
Save