Commit 9b672d40 authored by Michael Niedermayer's avatar Michael Niedermayer

vf_mp: mp buffers are not compatible with the reference count system

We thus must copy each frame on the vf_mp output.

This fixes artifacts with "ffplay -threads 1 dnxhdconv.mov -vf mp=eq2=1:1"
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 87dd62e1
...@@ -568,16 +568,18 @@ int ff_vf_next_put_image(struct vf_instance *vf,mp_image_t *mpi, double pts){ ...@@ -568,16 +568,18 @@ int ff_vf_next_put_image(struct vf_instance *vf,mp_image_t *mpi, double pts){
memcpy(picref->linesize, mpi->stride, FFMIN(sizeof(picref->linesize), sizeof(mpi->stride))); memcpy(picref->linesize, mpi->stride, FFMIN(sizeof(picref->linesize), sizeof(mpi->stride)));
for(i=0; i<4 && mpi->stride[i]; i++){ for(i=0; i<4 && mpi->stride[i]; i++){
picref->buf[i] = av_buffer_create(mpi->planes[i], mpi->stride[i], dummy_free, NULL, picref->data[i] = mpi->planes[i];
(mpi->flags & MP_IMGFLAG_PRESERVE) ? AV_BUFFER_FLAG_READONLY : 0);
if (!picref->buf[i])
goto fail;
picref->data[i] = picref->buf[i]->data;
} }
if(pts != MP_NOPTS_VALUE) if(pts != MP_NOPTS_VALUE)
picref->pts= pts * av_q2d(outlink->time_base); picref->pts= pts * av_q2d(outlink->time_base);
if(1) { // mp buffers are currently unsupported in libavfilter, we thus must copy
AVFrame *tofree = picref;
picref = av_frame_clone(picref);
av_frame_free(&tofree);
}
ff_filter_frame(outlink, picref); ff_filter_frame(outlink, picref);
m->frame_returned++; m->frame_returned++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment