[FFmpeg-trac] #2702(avformat:new): Faulty handling of file: protocol on Windows

FFmpeg trac at avcodec.org
Mon Jun 24 14:47:35 CEST 2013


#2702: Faulty handling of file: protocol on Windows
-------------------------------------+-------------------------------------
             Reporter:  hendrik      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avformat     |                  Version:
             Keywords:  url windows  |  unspecified
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------
 Summary of the bug:

 In the dev documentation it is mentioned that one can open resources
 either via a filename, a URL or some other form of custom `AVIOContext`.

 But in its current form FFmpeg does not seem to support well formed
 Windows file URLs.

 On Windows, the scheme part (`file:`) is always followed by a bunch of
 slashes, usually three (`file:///`), before the drive designator.
 A correct local file URL is e.g.:

 {{{
 file:///C:/somePath/someFile.mp3
 }}}

 A more complete explanation can be found at
 http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx

 Contrary to this, in `libavformat/file.c` (`static int
 file_open(URLContext *h, const char *filename, int flags)`, line 112)
 FFmpeg simply cuts off "file:" in line 119 and thinks it is done.

 Unfortunately,

 {{{
 open("///C:/somePath/someFile.mp3", access, 0666); // line 135
 }}}

 leads to `EINVAL/Invalid Argument`. This function is called via
 `avio_open2`, which is called by `avformat_open_input`.

 This bug was already discussed on libav-user: http://libav-
 users.943685.n4.nabble.com/Libav-user-Faulty-handling-of-file-protocol-on-
 Windows-td4657921.html

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2702>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list