[FFmpeg-devel] [PATCH] pix_fmt support function error handling

Michael Niedermayer michaelni
Sat Aug 2 13:02:51 CEST 2008


On Sat, Aug 02, 2008 at 03:56:03PM +1000, pross at xvid.org wrote:
> Patch adds graceful error handling to avcodec_get_pix_fmt_name() and
> avcodec_get_pix_fmt().
> 
> -- Peter
> (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)

> Index: libavcodec/imgconvert.c
> ===================================================================
> --- libavcodec/imgconvert.c	(revision 14502)
> +++ libavcodec/imgconvert.c	(working copy)
> @@ -390,7 +390,7 @@
>  const char *avcodec_get_pix_fmt_name(int pix_fmt)
>  {
>      if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB)
> -        return "???";
> +        return NULL;
>      else
>          return pix_fmt_info[pix_fmt].name;
>  }
> @@ -401,8 +401,8 @@
>  
>      for (i=0; i < PIX_FMT_NB; i++)
>           if (!strcmp(pix_fmt_info[i].name, name))
> -             break;
> -    return i;
> +             return i;
> +    return SAMPLE_FMT_NONE;
>  }

PIX_FMT_NONE ...

and patch ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- 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/20080802/10536fc9/attachment.pgp>



More information about the ffmpeg-devel mailing list