diff options
author | Janne Grunau <janne-ffmpeg@jannau.net> | 2010-05-29 14:33:02 +0000 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2010-05-29 14:33:02 +0000 |
commit | 3fa19f68287be4fc06776a4a52a7415e47822876 (patch) | |
tree | 508932d8e9323e128fb89a617d67a157a76536aa /libavcodec/utils.c | |
parent | 4e62a6738972275ab4cda625304f1cd25d8a0772 (diff) | |
download | ffmpeg-3fa19f68287be4fc06776a4a52a7415e47822876.tar.gz |
Add CODEC_CAP_EXPERIMENTAL and prefer encoders without it.
Patch by Janne Grunau, janne-ffmpeg jannau net
backport r23334,23337-23338 by cehoyos and stefano
Originally committed as revision 23379 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 87facec8f4..014427d59f 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -724,14 +724,18 @@ av_cold int avcodec_close(AVCodecContext *avctx) 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) |