[zip] allow libdvd to view ZIP root as directory to enable playback of zipped dvd...
authorVoyager1 <voyager@xbmc.org>
Sat, 1 Mar 2014 09:17:03 +0000 (10:17 +0100)
committerVoyager1 <voyager@xbmc.org>
Sun, 2 Mar 2014 06:58:12 +0000 (07:58 +0100)
xbmc/filesystem/ZipFile.cpp

index e34e229..8839dde 100644 (file)
@@ -266,7 +266,15 @@ int CZipFile::Stat(struct __stat64 *buffer)
 int CZipFile::Stat(const CURL& url, struct __stat64* buffer)
 {
   if (!g_ZipManager.GetZipEntry(url.Get(),mZipItem))
-    return -1;
+  {
+    if (url.GetFileName().empty() && CFile::Exists(url.GetHostName()))
+    { // when accessing the zip "root" recognize it as a directory
+      buffer->st_mode = _S_IFDIR;
+      return 0;
+    }
+    else
+      return -1;
+  }
 
   memset(buffer, 0, sizeof(struct __stat64));
   buffer->st_gid = 0;