}
if (type == AVMEDIA_TYPE_VIDEO) {
- AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc();
-
- buffersink_params->pixel_fmts = pix_fmts;
ret = avfilter_graph_create_filter(&sink, buffersink,
inout->name, NULL,
- buffersink_params, lavfi->graph);
- av_freep(&buffersink_params);
-
+ NULL, lavfi->graph);
+ if (ret >= 0)
+ ret = av_opt_set_int_list(sink, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
if (ret < 0)
goto end;
} else if (type == AVMEDIA_TYPE_AUDIO) {
AV_SAMPLE_FMT_S32,
AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_DBL, -1 };
- AVABufferSinkParams *abuffersink_params = av_abuffersink_params_alloc();
- abuffersink_params->sample_fmts = sample_fmts;
ret = avfilter_graph_create_filter(&sink, abuffersink,
inout->name, NULL,
- abuffersink_params, lavfi->graph);
- av_free(abuffersink_params);
+ NULL, lavfi->graph);
+ if (ret >= 0)
+ ret = av_opt_set_int_list(sink, "sample_fmts", sample_fmts, AV_SAMPLE_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
if (ret < 0)
goto end;
}