[FFmpeg-devel] [PATCH] Implement av_strerror()

Michael Niedermayer michaelni
Fri Mar 26 13:03:41 CET 2010


On Thu, Mar 25, 2010 at 11:57:27PM +0100, Stefano Sabatini wrote:
> On date Sunday 2010-03-14 13:03:58 +0100, Stefano Sabatini encoded:
> [...]
> > ---
> >  cmdutils.c |   30 ++++--------------------------
> >  1 files changed, 4 insertions(+), 26 deletions(-)
> > 
> > diff --git a/cmdutils.c b/cmdutils.c
> > index a4306d0..1fe4387 100644
> > --- a/cmdutils.c
> > +++ b/cmdutils.c
> > @@ -291,39 +291,17 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags)
> >  
> >  void print_error(const char *filename, int err)
> >  {
> > +    char errbuf[128];
> > +
> >      switch(err) {
> > -    case AVERROR_NUMEXPECTED:
> > -        fprintf(stderr, "%s: Incorrect image filename syntax.\n"
> > -                "Use '%%d' to specify the image number:\n"
> > -                "  for img1.jpg, img2.jpg, ..., use 'img%%d.jpg';\n"
> > -                "  for img001.jpg, img002.jpg, ..., use 'img%%03d.jpg'.\n",
> > -                filename);
> > -        break;
> > -    case AVERROR_INVALIDDATA:
> > -        fprintf(stderr, "%s: Error while parsing header\n", filename);
> > -        break;
> > -    case AVERROR_NOFMT:
> > -        fprintf(stderr, "%s: Unknown format\n", filename);
> > -        break;
> > -    case AVERROR(EIO):
> > -        fprintf(stderr, "%s: I/O error occurred\n"
> > -                "Usually that means that input file is truncated and/or corrupted.\n",
> > -                filename);
> > -        break;
> > -    case AVERROR(ENOMEM):
> > -        fprintf(stderr, "%s: memory allocation error occurred\n", filename);
> > -        break;
> > -    case AVERROR(ENOENT):
> > -        fprintf(stderr, "%s: no such file or directory\n", filename);
> > -        break;
> >  #if CONFIG_NETWORK
> >      case AVERROR(FF_NETERROR(EPROTONOSUPPORT)):
> >          fprintf(stderr, "%s: Unsupported network protocol\n", filename);
> >          break;
> >  #endif
> >      default:
> > -        fprintf(stderr, "%s: Error while opening file\n", filename);
> > -        break;
> > +        av_strerror(err, errbuf, sizeof(errbuf));
> > +        fprintf(stderr, "%s: %s\n", filename, errbuf);
> >      }
> >  }
> 
> Ping?

ok

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- 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/20100326/ab50154d/attachment.pgp>



More information about the ffmpeg-devel mailing list