Skip to content

Commit c194242

Browse files
ruiling-songlizhong1008
authored andcommitted
lavf: clone the frame managed by framework.
we should clone the frame, which is managed by the framework. directly assign it will cause double-free issue when qsv try to free it. In fact, the frames was managed by the framework! Right now, I am still not quite sure why we receive 'more data' error from libmfx. But some simple debugging seems that it is non-sense. so just skip it totally, not bothering to return a EAGAIN error to the caller. Signed-off-by: Ruiling Song <ruiling.song@intel.com>
1 parent 6739467 commit c194242

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

libavfilter/qsvvpp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static QSVFrame *submit_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *p
296296
av_log(ctx, AV_LOG_ERROR, "QSVVPP gets a wrong frame.\n");
297297
return NULL;
298298
}
299-
qsv_frame->frame = picref;
299+
qsv_frame->frame = av_frame_clone(picref);
300300
qsv_frame->surface = (mfxFrameSurface1 *)qsv_frame->frame->data[3];
301301
} else {
302302
/* make a copy if the input is not padded as libmfx requires */
@@ -318,7 +318,7 @@ static QSVFrame *submit_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *p
318318
av_frame_copy_props(qsv_frame->frame, picref);
319319
av_frame_free(&picref);
320320
} else
321-
qsv_frame->frame = picref;
321+
qsv_frame->frame = av_frame_clone(picref);
322322

323323
if (map_frame_to_surface(qsv_frame->frame,
324324
&qsv_frame->surface_internal) < 0) {
@@ -707,7 +707,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr
707707
if (ret < 0 && ret != MFX_ERR_MORE_SURFACE) {
708708
/* Ignore more_data error */
709709
if (ret == MFX_ERR_MORE_DATA)
710-
ret = AVERROR(EAGAIN);
710+
ret = 0;
711711
break;
712712
}
713713

0 commit comments

Comments
 (0)