[FFmpeg-devel] [PATCH] libavfilter - avfilter_make_format_list skips sentinel -1
Robert Nagy
ronag89 at gmail.com
Wed Nov 23 13:41:26 CET 2011
T <http://pastebin.com/JDPhT8Vh>he following code causes the problem for me
(I rewrite it to C so that you can compile it).
void foo()
{
AVFilterGraph* graph = avfilter_graph_alloc();
AVFilterContext* buffersink_ctx = nullptr;
AVFilterContext* buffersrc_ctx = nullptr;
char args[1024] = {};
sprintf(args, "%d:%d:%d:%d:%d:%d:%d", 1024, 576, PIX_FMT_BGRA, 0, 0, 0, 0);
avfilter_graph_create_filter(&buffersrc_ctx,
avfilter_get_by_name("buffer"), "src", args, NULL, graph);
AVBufferSinkParams* buffersink_params = av_buffersink_params_alloc();
PixelFormat fmts[] = {PIX_FMT_BGRA, PIX_FMT_NONE};
buffersink_params->pixel_fmts = fmts;
avfilter_graph_create_filter(&buffersink_ctx,
avfilter_get_by_name("buffersink"), "out", NULL, buffersink_params, graph);
AVFilterInOut* outputs = avfilter_inout_alloc();
AVFilterInOut* inputs = avfilter_inout_alloc();
outputs->name = av_strdup("in");
outputs->filter_ctx = buffersrc_ctx;
outputs->pad_idx = 0;
outputs->next = NULL;
inputs->name = av_strdup("out");
inputs->filter_ctx = buffersink_ctx;
inputs->pad_idx = 0;
inputs->next = NULL;
avfilter_graph_parse(graph, "yadif=0:-1", &inputs, &outputs, NULL);
avfilter_inout_free(&inputs);
avfilter_inout_free(&outputs);
avfilter_graph_config(graph, NULL);
}
More information about the ffmpeg-devel
mailing list