[FFmpeg-devel] abuffersink without opaque

Stefano Sabatini stefasab at gmail.com
Tue May 29 14:24:35 CEST 2012


On date Monday 2012-05-28 23:13:01 +0200, Robert Nagy encoded:
> Looking at abuffersink and asink_init i notice that the abuffersink
> requires that an opaque is passed.
> 
>     if (!opaque) {
>         av_log(ctx, AV_LOG_ERROR,
>                "No opaque field provided, an AVABufferSinkParams
> struct is required\n");
>         return AVERROR(EINVAL);
>     }
> 

That was the expected behavior, you need to specify the accepted
formats (which could be "all", in this case the user is expected to
fill the list with "all" formats). Check for example the code in
libavdevice.c/lavfi.c or doc/examples/filtering_audio.c.

I don't know why the error was replaced by a simple warning in
buffersrc, that has something to do with libav merges, my wild guess
is that it can currently work because of the bogus logic adopted by
the "new" format API (no formats specified = all formats supported).

> I find this a bit peculiar since the "buffersink" for video just sets
> the "common_formats" if no opaque is passed. Also looking at ffmpeg I
> notice the following code:
> 
> avfilter_graph_create_filter(&ofilter->filter,
>                                        avfilter_get_by_name("abuffersink"),
>                                        "out", NULL, NULL, fg->graph);
> 
> Which as far as I understand shouldn't work, due to the asink_init code above.

Lost track of the changes in ffmpeg.c, is that code even reachable?

> Shouldn't we have something like the attached patch?
-- 
FFmpeg = Furious and Fantastic Multimedia Pacific Ecumenical Genius


More information about the ffmpeg-devel mailing list