[FFmpeg-devel] [PATCH] Codec lookup: do not use codec_id

Michael Niedermayer michaelni
Wed Jun 20 03:25:14 CEST 2007


On Tue, Jun 19, 2007 at 01:13:36PM +0200, Nicolas George wrote:
> Le decadi 30 prairial, an CCXV, Michael Niedermayer a ?crit?:
> > why dont you replace the int *codec_id by a char * ?
> I find more logical and efficient to do the as soon as possible rather than
> having a call to avcodec_find_by_name each time the codec is used.
> > this looks like an ugly hack
> I agree with that, but the real hack was already there. More specifically:
> - The current implementation uses the codec_id field of the AVCodecContext
>   structure to store the CodecID of the codec it wants to use later.
> - I want to use the codec field for the same purpose.

i have a very bad feeling about this, this needs very extensive testing
stream copy with missing decoder/encoder and multiple input and output files
amongth others

> > the != NULL is unneeded
> As a rule, I only use "if(foo)" when foo is an integer variable whose sole
> purpose is to hold a boolean. Everywhere else, I explicitely write "== 0" or
> "== NULL". I believe it makes the intent of the code more apparent.

i see, could you still please remove it for changes to files which use
a different style

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070620/06ebc689/attachment.pgp>

More information about the ffmpeg-devel mailing list