mirror of https://git.ffmpeg.org/ffmpeg.git
buffersrc: use avfilter_get_buffer_ref_from_frame.
This commit is contained in:
parent
5c5f75b92b
commit
05776119c1
|
@ -83,16 +83,8 @@ int av_buffersrc_add_frame(AVFilterContext *buffer_src,
|
||||||
if (!frame) /* NULL for EOF */
|
if (!frame) /* NULL for EOF */
|
||||||
return av_buffersrc_add_ref(buffer_src, NULL, flags);
|
return av_buffersrc_add_ref(buffer_src, NULL, flags);
|
||||||
|
|
||||||
switch (buffer_src->outputs[0]->type) {
|
picref = avfilter_get_buffer_ref_from_frame(buffer_src->outputs[0]->type,
|
||||||
case AVMEDIA_TYPE_VIDEO:
|
frame, AV_PERM_WRITE);
|
||||||
picref = avfilter_get_video_buffer_ref_from_frame(frame, AV_PERM_WRITE);
|
|
||||||
break;
|
|
||||||
case AVMEDIA_TYPE_AUDIO:
|
|
||||||
picref = avfilter_get_audio_buffer_ref_from_frame(frame, AV_PERM_WRITE);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return AVERROR(ENOSYS);
|
|
||||||
}
|
|
||||||
if (!picref)
|
if (!picref)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
ret = av_buffersrc_add_ref(buffer_src, picref, flags);
|
ret = av_buffersrc_add_ref(buffer_src, picref, flags);
|
||||||
|
|
Loading…
Reference in New Issue