[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:01:56 CEST 2012


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed May 23 21:58:46 2012 +0200| [8de46adc1189fe3a3ad7c127896ec026d9da3d62] | committer: Laurent Aimar

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

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

 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 0819755..630bca2 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