New submission from Bob <[email protected]>:
url_open() fails to properly parse paths containing drive letters on windows,
such as "C:\\myfile.avi". The attached patch is one possible solution.
----------
files: ffmpeg.windows_path_issue.patch
messages: 10497
priority: normal
status: new
substatus: new
title: url_open() doesn't handle drive letters properly on Windows
topic: avformat
type: patch
________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/issue1935>
________________________________________________
diff -rupwbBEN --strip-trailing-cr -x .svn ../dnl5/ffmpeg/libavformat/avio.c ffmpeg/libavformat/avio.c
--- ../dnl5/ffmpeg/libavformat/avio.c 2010-05-13 13:12:32.000000000 -0400
+++ ffmpeg/libavformat/avio.c 2010-05-13 11:25:51.000000000 -0400
@@ -126,6 +126,12 @@ int url_open(URLContext **puc, const cha
p = filename;
q = proto_str;
+
+ /* Check for dos drive */
+ if (*p && ':' == p[ 1 ])
+ strcpy(proto_str, "file");
+
+ else {
while (*p != '\0' && *p != ':') {
/* protocols can only contain alphabetic chars */
if (!isalpha(*p))
@@ -141,6 +148,7 @@ int url_open(URLContext **puc, const cha
} else {
*q = '\0';
}
+ }
up = first_protocol;
while (up != NULL) {