[vlc-commits] rar: + Support for up to 1001 volume old naming style archive.

John Peterson git at videolan.org
Thu May 3 01:00:00 CEST 2012


vlc | branch: master | John Peterson <john.peterson3 at hotmail.com> | Sun Apr 22 06:35:02 2012 +0200| [0ba86c3412976f39dc45caf11c64e2d8168aea42] | committer: Laurent Aimar

rar: + Support for up to 1001 volume old naming style archive.

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

 modules/access/rar/rar.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/access/rar/rar.c b/modules/access/rar/rar.c
index ce35504..0819755 100644
--- a/modules/access/rar/rar.c
+++ b/modules/access/rar/rar.c
@@ -289,7 +289,7 @@ static const rar_pattern_t *FindVolumePattern(const char *location)
         { ".part1.rar",   "%s.part%.1d.rar", 2,   9 },
         { ".part01.rar",  "%s.part%.2d.rar", 2,  99, },
         { ".part001.rar", "%s.part%.3d.rar", 2, 999 },
-        { ".rar",         "%s.r%.2d",        0,  99 },
+        { ".rar",         "%s.%c%.2d",       0, 999 },
         { NULL, NULL, 0, 0 },
     };
 
@@ -379,8 +379,14 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file)
         }
 
         free(volume_mrl);
-        if (asprintf(&volume_mrl, pattern->format, volume_base, volume_index) < 0)
-            volume_mrl = NULL;
+        if (pattern->start) {
+            if (asprintf(&volume_mrl, pattern->format, volume_base, volume_index) < 0)
+                volume_mrl = NULL;
+        } else {
+            if (asprintf(&volume_mrl, pattern->format, volume_base,
+                         'r' + volume_index / 100, volume_index % 100) < 0)
+                volume_mrl = NULL;
+        }
         free(volume_base);
 
         if (!volume_mrl)



More information about the vlc-commits mailing list