[FFmpeg-devel] [RFC] check avcodec_open codec paramert != NULL

Michael Niedermayer michaelni
Tue Dec 25 16:28:21 CET 2007

On Tue, Dec 25, 2007 at 01:32:48PM +0100, Reimar D?ffinger wrote:
> Hello,
> I personally would prefer if the avcodec_open would check if codec is
> NULL and return an error then.
> The main reason is laziness: You can then just do
> avcodec_open(vf->priv->avctx, avcodec_find_encoder(CODEC_ID_PNG))
> instead of having an extra variable for the avcodec_find_encoder result
> and checking it against NULL.
> What do you think? I admit it encourages sloppy error checking but I
> just hate doing more checks that absolutely necessary, it clutters the
> code too much for my tastes.


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I hate to see young programmers poisoned by the kind of thinking
Ulrich Drepper puts forward since it is simply too narrow -- Roman Shaposhnik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071225/a7c01e47/attachment.pgp>

More information about the ffmpeg-devel mailing list