[vlc-commits] Hide errors with multi-part rar when the end of archive block is missing.

Laurent Aimar git at videolan.org
Wed May 23 22:11:38 CEST 2012


vlc/vlc-2.0 | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed May 23 21:58:46 2012 +0200| [f352ed335818dce18fffd5dbf269f6da9fddda18] | committer: Jean-Baptiste Kempf

Hide errors with multi-part rar when the end of archive block is missing.
(cherry picked from commit 8de46adc1189fe3a3ad7c127896ec026d9da3d62)

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

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

 modules/access/rar/rar.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/access/rar/rar.c b/modules/access/rar/rar.c
index d9092eb..179e260 100644
--- a/modules/access/rar/rar.c
+++ b/modules/access/rar/rar.c
@@ -330,7 +330,7 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file)
         }
 
         /* */
-        int has_next = 1;
+        int has_next = -1;
         for (;;) {
             rar_block_t bk;
             int ret;
@@ -353,8 +353,8 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file)
             if (ret)
                 break;
         }
-        if (has_next < 0)
-            has_next = *count > 0 && !(*file)[*count -1]->is_complete;
+        if (has_next < 0 && *count > 0 && !(*file)[*count -1]->is_complete)
+            has_next = 1;
         if (vol != s)
             stream_Delete(vol);
 
@@ -391,7 +391,12 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file)
 
         if (!volume_mrl)
             return VLC_SUCCESS;
+
+        const int s_flags = s->i_flags;
+        if (has_next < 0)
+            s->i_flags |= OBJECT_FLAGS_NOINTERACT;
         vol = stream_UrlNew(s, volume_mrl);
+        s->i_flags = s_flags;
 
         if (!vol) {
             free(volume_mrl);



More information about the vlc-commits mailing list