Mercurial > libavcodec.hg
diff utils.c @ 11771:3c0dffc64d86 libavcodec
Add CODEC_CAP_EXPERIMENTAL and prefer encoders without it.
Patch by Janne Grunau, janne-ffmpeg jannau net
author | cehoyos |
---|---|
date | Wed, 26 May 2010 10:38:48 +0000 |
parents | a37818ac3817 |
children | 22b17f922f2b |
line wrap: on
line diff
--- a/utils.c Wed May 26 04:20:32 2010 +0000 +++ b/utils.c Wed May 26 10:38:48 2010 +0000 @@ -725,14 +725,18 @@ AVCodec *avcodec_find_encoder(enum CodecID id) { - AVCodec *p; + AVCodec *p, *experimental=NULL; p = first_avcodec; while (p) { - if (p->encode != NULL && p->id == id) - return p; + if (p->encode != NULL && p->id == id) { + if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) { + experimental = p; + } else + return p; + } p = p->next; } - return NULL; + return experimental; } AVCodec *avcodec_find_encoder_by_name(const char *name)