[FFmpeg-devel] av_open_input_file

Stefano Sabatini stefano.sabatini-lala
Sat Dec 11 00:13:23 CET 2010


On date Friday 2010-12-10 11:54:45 -0800, Fabrizio Milo aka misto encoded:
> Something like this?
> 
> index 9a4d735..05c8c18 100644
> --- a/libavformat/avio.c
> +++ b/libavformat/avio.c
> @@ -184,6 +184,10 @@ int url_alloc(URLContext **puc, const char
> *filename, int flags)
>          av_strlcpy(proto_str, filename, FFMIN(proto_len+1, sizeof(proto_str)));
> 
>      up = first_protocol;
> +    if (up == NULL) // No format registered
> +    {
> +        return AVERROR_NOFMT;
> +    }

Use AVERROR(ENOSYS) or AVERROR(EINVAL), I'm not sure which is more
correct in this case, for the higly philosophical reasons for which
AVERROR_NOFMT has been dropped read:
http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/106104/focus=106778

Also the patch looks wrong, you should return that error when there is
no corresponding protocol, not only when there are no registered
protocols.
-- 
FFmpeg = Free & Fundamental Magnificient Practical Evangelical Game



More information about the ffmpeg-devel mailing list