[FFmpeg-devel] [PATCH] Default to using libraries when enabled

Michael Niedermayer michaelni
Wed May 26 02:04:28 CEST 2010


On Wed, May 26, 2010 at 12:39:28AM +0200, Janne Grunau wrote:
> On Wed, May 26, 2010 at 12:15:32AM +0200, Janne Grunau wrote:
> > On Sun, May 23, 2010 at 03:04:01PM -0700, Baptiste Coudurier wrote:
> > > On 5/23/10 2:59 PM, Janne Grunau wrote:
> > > > On Sun, May 23, 2010 at 06:41:35PM +0200, Michael Niedermayer wrote:
> > > >
> > > >> the rest of the patch is ok with me
> > > 
> > > Humm won't this have side effects for decoder developpers ?
> > > 
> > > Manually selecting encoders is easy, but not decoders.
> > > 
> > > For encoders I think I'm ok.
> > 
> > see attached patch
> 
> 10l wrong patch, sorry
> 
> Janne
> 

>  avcodec.h |    5 +++++
>  utils.c   |   12 ++++++++----
>  2 files changed, 13 insertions(+), 4 deletions(-)
> 60c66792aeb93313fedc90c773a48572a01cb9b6  avoid_experimental_encoders2.diff
> commit 2e69c61f56088207757759f96a071d1b12161407
> Author: Janne Grunau <janne at grunau.be>
> Date:   Sat May 22 02:19:30 2010 +0200
> 
>     add CODEC_CAP_EXPERIMENTAL and prefer encoders without it
>     
>     avcodec_find_encoder returns only imidiately if CODEC_CAP_EXPERIMENTAL
>     is not set. The first experimental codec is saved and returned if no
>     non-experimental encoder was found.
[...]

> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 56d4dbd..9d823aa 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

if{}else
patcheck should have told you

patch ok otherwise

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100526/f6517a88/attachment.pgp>



More information about the ffmpeg-devel mailing list