[vlc-commits] commit: fix fd:// broken by [370b6cbb300] ( Rafaël Carré )

git at videolan.org git at videolan.org
Sat Jun 26 18:07:28 CEST 2010


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Sat Jun 26 18:06:49 2010 +0200| [06a4528b4b5cda65690a5bec5b4c8a78be9ef2bc] | committer: Rafaël Carré 

fix fd:// broken by [370b6cbb300]

file descriptor number is not a file path

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=06a4528b4b5cda65690a5bec5b4c8a78be9ef2bc
---

 modules/access/file.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/access/file.c b/modules/access/file.c
index 9d3de77..7485c95 100644
--- a/modules/access/file.c
+++ b/modules/access/file.c
@@ -134,7 +134,6 @@ static bool IsRemote (int fd)
 int Open( vlc_object_t *p_this )
 {
     access_t     *p_access = (access_t*)p_this;
-    const char   *path = p_access->psz_filepath;
 #ifdef WIN32
     bool is_remote = false;
 #endif
@@ -145,11 +144,11 @@ int Open( vlc_object_t *p_this )
     if (!strcasecmp (p_access->psz_access, "fd"))
     {
         char *end;
-        int oldfd = strtol (path, &end, 10);
+        int oldfd = strtol (p_access->psz_location, &end, 10);
 
         if (*end == '\0')
             fd = vlc_dup (oldfd);
-        else if (*end == '/' && end > path)
+        else if (*end == '/' && end > p_access->psz_location)
         {
             char *name = decode_URI_duplicate (end - 1);
             if (name != NULL)
@@ -162,6 +161,8 @@ int Open( vlc_object_t *p_this )
     }
     else
     {
+        const char *path = p_access->psz_filepath;
+
         msg_Dbg (p_access, "opening file `%s'", path);
         fd = vlc_open (path, O_RDONLY | O_NONBLOCK);
         if (fd == -1)



More information about the vlc-commits mailing list