diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-13 15:00:22 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-13 15:02:51 +0200 |
commit | 9b672d4017bb34992045da2632c3599da791cbc6 (patch) | |
tree | ff4b99d7980fa29a74a24bfe24876741abcd8a71 | |
parent | 87dd62e141985599974ede08d17f66691e9dd6c2 (diff) | |
download | ffmpeg-9b672d4017bb34992045da2632c3599da791cbc6.tar.gz |
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: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavfilter/vf_mp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavfilter/vf_mp.c b/libavfilter/vf_mp.c index 9a05997dec..53cdd93d56 100644 --- a/libavfilter/vf_mp.c +++ b/libavfilter/vf_mp.c @@ -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))); for(i=0; i<4 && mpi->stride[i]; i++){ - picref->buf[i] = av_buffer_create(mpi->planes[i], mpi->stride[i], dummy_free, NULL, - (mpi->flags & MP_IMGFLAG_PRESERVE) ? AV_BUFFER_FLAG_READONLY : 0); - if (!picref->buf[i]) - goto fail; - picref->data[i] = picref->buf[i]->data; + picref->data[i] = mpi->planes[i]; } if(pts != MP_NOPTS_VALUE) 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); m->frame_returned++; |