[FFmpeg-devel] [PATCH 4/4] ffplay: do not set redundant channel count on abuffersink.

Marton Balint cus at passwd.hu
Thu Aug 20 11:10:44 EEST 2020



On Thu, 20 Aug 2020, Nicolas George wrote:

> Marton Balint (12020-08-20):
>> Why it is better if we don't set it?
>
> It is how the API was supposed to be used from the start: these values
> set the formats list for buffersink. If you said you accept anything
> with two channels, then you do not need to say you accept stereo, it is
> already said. It was already documented in formats.h:
>
> * - The list must not contain a layout with a known disposition and a
> *   channel count with unknown disposition with the same number of channels
> *   (e.g. AV_CH_LAYOUT_STEREO and FF_COUNT2LAYOUT(2).
>
> Of course, a private header is not the proper place to document a public
> API, which is what I correct in patch #2.
>
> In practice, applications know if they want a number of channels or a
> specific channel layout, and should only set one. In this case I am not
> familiar enough with SDL's API to be sure, so I made the minimal change.

LGTM, thanks.

Regards,
Marton


More information about the ffmpeg-devel mailing list