[FFmpeg-devel] [PATCH] Make libavformat/avio.c:url_open return EILSEQ error code in case of unrecognized protocol prefix

Michael Niedermayer michaelni
Tue Oct 16 22:07:23 CEST 2007


On Tue, Oct 16, 2007 at 10:01:41AM +0200, Stefano Sabatini wrote:
> On date Monday 2007-10-15 19:38:08 +0200, Michael Niedermayer encoded:
> > On Mon, Oct 15, 2007 at 02:20:26PM +0200, Stefano Sabatini wrote:
> [...]
> > > Index: libavformat/avio.c
> > > ===================================================================
> > > --- libavformat/avio.c	(revision 10629)
> > > +++ libavformat/avio.c	(working copy)
> > > @@ -68,7 +68,8 @@
> > >              goto found;
> > >          up = up->next;
> > >      }
> > > -    err = AVERROR(ENOENT);
> > > +    av_log(NULL, AV_LOG_ERROR, "Unrecognized protocol: %s\n", proto_str);
> > > +    err = AVERROR(EILSEQ);
> > 
> > theres no relation between the addition of the error message and the change
> > of the return, these should be in seperate patches
> > also NULL is not a good choice
> 
> OK.
> 
> Changing again patch and thread name.
> 
> Suggested log: $subject
> 
> Rationale: in avcodec.h are defined the various error codes.
> 
> ENOENT corresponds to the error:
> "No such file or directory."
> 
> which doesn't seem really descriptive about the error encountered in
> this case (unrecognized protocol).
> 
> EILSEQ corresponds to the error
> "unknown format."
> 
> and seems more adequate in this case.
> 
> This patch also indirectly changes the error message issued, so we'll
> have now:
> 
> stefano at geppetto ~/s/m/samples> ffmpeg -i foo:movie.avi 
> [...]
> foo:movie.avi: Unknown format
> 
> rather than:
> stefano at geppetto ~/s/m/samples> ffmpeg -i foo:movie.avi
> FFmpeg version SVN-r10755, Copyright (c) 2000-2007 Fabrice Bellard, et al.
> [...]
> foo:movie.avi: No such file or directory

besides the question about appropriateness of EILSEQ
(Invalid or incomplete multibyte or wide character)
"Unknown format" is hardly better than "No such file or directory"

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- 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/20071016/be73efa0/attachment.pgp>



More information about the ffmpeg-devel mailing list