[FFmpeg-devel] [PATCH] [RFC] Make avcodec_open find the default if codec is null
Sun Dec 12 23:43:15 CET 2010
On date Sunday 2010-12-12 23:18:52 +0100, Michael Niedermayer encoded:
> 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 ...
> > - There is no satisfactory error code. I made another patch adding error
> > codes for demuxer/muxer/decoder/encoder not found.
> i dont mind these error codes being added if you think they are usefull
While at it also an error for missing protocols as suggested in the
FFmpeg = Fast and Foolish Mournful Philosofic Exxagerate Guru
More information about the ffmpeg-devel