[RFC] check avcodec_open codec paramert != NULL
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. Greetings, Reimar D?ffinger
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.
ok [...] -- 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
participants (2)
-
michaelni@gmx.at -
Reimar.Doeffinger@stud.uni-karlsruhe.de