[FFmpeg-devel] [PATCH] [RFC] Make avcodec_open find the default if codec is null
Nicolas George
nicolas.george
Sun Dec 12 19:34:40 CET 2010
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.
- There is no satisfactory error code. I made another patch adding error
codes for demuxer/muxer/decoder/encoder not found.
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-defaultcodec-20101212-1920-01-defaultcodec.diff
Type: text/x-diff
Size: 1466 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101212/f78456db/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-errnotfound-20101212-1920-01-errnotfound.diff
Type: text/x-diff
Size: 1669 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101212/f78456db/attachment-0001.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101212/f78456db/attachment.pgp>
More information about the ffmpeg-devel
mailing list