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

Stefano Sabatini stefano.sabatini-lala
Wed Oct 17 10:50:10 CEST 2007


On date Tuesday 2007-10-16 22:07:23 +0200, Michael Niedermayer encoded:
[...]
> > 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"

Could you suggest a better error code to use, or should we define a
new one?

Relevant thread: 
http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/54308/focus=54361

Regards.
-- 
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)




More information about the ffmpeg-devel mailing list