diff options
author | Janne Grunau <janne-ffmpeg@jannau.net> | 2010-05-26 14:38:48 +0400 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2010-05-26 14:38:48 +0400 |
commit | 93ebfeea90be8cc270226ac4d282efffed7ca0c7 (patch) | |
tree | 2749a18714170dae450c4e652c4e1f9bab22d898 /libavcodec/utils.c | |
parent | 1ed87f800f6c25ada8d1d98e2e6affbd5909503e (diff) |
Add CODEC_CAP_EXPERIMENTAL and prefer encoders without it.
Patch by Janne Grunau, janne-ffmpeg jannau net
Originally committed as revision 23334 to svn://svn.ffmpeg.org/ffmpeg/trunk
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 56d4dbd1dd..54db3daec0 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -725,14 +725,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) |