# HG changeset patch # User cehoyos # Date 1274870328 0 # Node ID 3c0dffc64d86ee17180f29046bdb59de31e72272 # Parent 6d58a4f5e455fad5ab9c35505683980363ff2e13 Add CODEC_CAP_EXPERIMENTAL and prefer encoders without it. Patch by Janne Grunau, janne-ffmpeg jannau net diff -r 6d58a4f5e455 -r 3c0dffc64d86 avcodec.h --- a/avcodec.h Wed May 26 04:20:32 2010 +0000 +++ b/avcodec.h Wed May 26 10:38:48 2010 +0000 @@ -645,6 +645,11 @@ * as a last resort. */ #define CODEC_CAP_SUBFRAMES 0x0100 +/** + * Codec is experimental and is thus avoided in favor of non experimental + * encoders + */ +#define CODEC_CAP_EXPERIMENTAL 0x0200 //The following defines may change, don't expect compatibility if you use them. #define MB_TYPE_INTRA4x4 0x0001 diff -r 6d58a4f5e455 -r 3c0dffc64d86 utils.c --- 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)