[FFmpeg-devel] [PATCH] [RFC] Make avcodec_open find the default if codec is null

Baptiste Coudurier baptiste.coudurier
Mon Dec 13 00:11:26 CET 2010

On 12/12/10 2:18 PM, Michael Niedermayer wrote:
> On Sun, Dec 12, 2010 at 07:34:40PM +0100, Nicolas George wrote:
>> Hi.
>> I tried to implement Michael's recent suggestion:
>>> make libavcodec call avcodec_find_decoder() when codec=NULL and this becomes
>>> simpler
>> This gave the attached patch. It has a few glitches:
>> - avcodec_open relies on the codec parameter to know whether this is an
>>   encoder or a decoder. As decoders are probably more commonly needed than
>>   encoders, and as selecting a default encoder is less useful too, I had it
>>   default to search for a decoder.
>> - Among the few uses of avcodec_open in the current tree, at a quick glance,
>>   only a few would benefit from the change.
> yes, maybe this suggestion was not so good after all. I had not realized there
> would be encoder/decoder ambiguity ...

I think so too, API would seem awkward IMHO.

Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list