Commit 05776119 authored by Nicolas George's avatar Nicolas George

buffersrc: use avfilter_get_buffer_ref_from_frame.

parent 5c5f75b9
......@@ -83,16 +83,8 @@ int av_buffersrc_add_frame(AVFilterContext *buffer_src,
if (!frame) /* NULL for EOF */
return av_buffersrc_add_ref(buffer_src, NULL, flags);
switch (buffer_src->outputs[0]->type) {
case AVMEDIA_TYPE_VIDEO:
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);
}
picref = avfilter_get_buffer_ref_from_frame(buffer_src->outputs[0]->type,
frame, AV_PERM_WRITE);
if (!picref)
return AVERROR(ENOMEM);
ret = av_buffersrc_add_ref(buffer_src, picref, flags);
......
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