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

John Peterson git at videolan.org
Sun May 6 03:05:06 CEST 2012


vlc/vlc-2.0 | branch: master | John Peterson <john.peterson3 at hotmail.com> | Sun Apr 22 06:35:02 2012 +0200| [cf2819b228390f6e74f55f97796e66d9d0303b02] | committer: Jean-Baptiste Kempf

rar: + Support for up to 1001 volume old naming style archive.
(cherry picked from commit 0ba86c3412976f39dc45caf11c64e2d8168aea42)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 c4c2045..14ec5b8 100644
--- a/modules/access/rar/rar.c
+++ b/modules/access/rar/rar.c
@@ -286,7 +286,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 },
     };
 
@@ -376,8 +376,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