[FFmpeg-devel] [PATCH] Use file protocol to deal with bogus protocol strings

Rich Felker dalias
Fri Sep 28 01:05:37 CEST 2007


On Thu, Sep 27, 2007 at 11:11:09PM +0100, M?ns Rullg?rd wrote:
> Rich Felker <dalias at aerifal.cx> writes:
> 
> > On Thu, Sep 27, 2007 at 11:13:32PM +0200, Luca Barbato wrote:
> >> Stefano Sabatini wrote:
> >> > Another (maybe cleaner) solution would be to request the user to
> >> > specify the protocol string for ambiguos files such as foo:movie.mpeg,
> >> > which should then be specified as file:foo:movie.mpeg. Anyway in this
> >> > case ffmpeg should say something if it can't recognize the protocol
> >> > (for example: unrecognized protocol: foo), rather than simply negate
> >> > the existence of the file.
> >> 
> >> what about enforcing the "://" separator?
> >
> > I agree, this is the correct solution since it avoids using any
> > heuristics and cannot clash with valid filenames.
> 
> I see nothing invalid about such filenames.  Sure, the double slash is
> redundant, but not invalid.

OK, sorry I was unclear. I meant that it would never clash with the
sane canonical form of any pathname, not that it would be immune to
clashes with redundant slashes. BTW, POSIX allows the implementation
to reserve pathnames with a leading double-slash for purposes outside
the normal filesystem hierarchy. I don't think this also applies to
embedded double-slashes but it at least provides some basis for
considering them special.

In any case, it would mean that "normal" pathnames always work without
having to rely on heuristics.

Rich




More information about the ffmpeg-devel mailing list