[FFmpeg-devel] [PATCH] Make libavformat/avio.c:url_open return EILSEQ error code in case of unrecognized protocol prefix
Stefano Sabatini
stefano.sabatini-lala
Tue Oct 16 10:01:41 CEST 2007
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
Regards.
--
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: change-url-open-error-code-00.patch
Type: text/x-diff
Size: 391 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071016/7feff20c/attachment.patch>
More information about the ffmpeg-devel
mailing list