Mercurial > libavcodec.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
11770:6d58a4f5e455 | 11771:3c0dffc64d86 |
---|---|
723 return 0; | 723 return 0; |
724 } | 724 } |
725 | 725 |
726 AVCodec *avcodec_find_encoder(enum CodecID id) | 726 AVCodec *avcodec_find_encoder(enum CodecID id) |
727 { | 727 { |
728 AVCodec *p; | 728 AVCodec *p, *experimental=NULL; |
729 p = first_avcodec; | 729 p = first_avcodec; |
730 while (p) { | 730 while (p) { |
731 if (p->encode != NULL && p->id == id) | 731 if (p->encode != NULL && p->id == id) { |
732 return p; | 732 if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) { |
733 experimental = p; | |
734 } else | |
735 return p; | |
736 } | |
733 p = p->next; | 737 p = p->next; |
734 } | 738 } |
735 return NULL; | 739 return experimental; |
736 } | 740 } |
737 | 741 |
738 AVCodec *avcodec_find_encoder_by_name(const char *name) | 742 AVCodec *avcodec_find_encoder_by_name(const char *name) |
739 { | 743 { |
740 AVCodec *p; | 744 AVCodec *p; |