[vlc-commits] se/archive: do not reset source position if dead

Filip Roséen git at videolan.org
Fri Mar 17 19:05:41 CET 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Fri Mar 17 03:22:12 2017 +0100| [00951ad0092ff8ab1f905d88c88b62930efec9d3] | committer: Jean-Baptiste Kempf

se/archive: do not reset source position if dead

If the libarchive_exit_cb is called due to clean-up (because we are
dead), there is no point in seeking back to zero. It might even fail
if our source module reacts to vlc_killed (such as
stream_filter/cache_read).

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

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

 modules/stream_extractor/archive.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/stream_extractor/archive.c b/modules/stream_extractor/archive.c
index bc401ce..bb553bb 100644
--- a/modules/stream_extractor/archive.c
+++ b/modules/stream_extractor/archive.c
@@ -99,9 +99,8 @@ static int libarchive_exit_cb( libarchive_t* p_arc, void* p_obj )
     libarchive_callback_t* p_cb = (libarchive_callback_t*)p_obj;
 
     if( p_cb->p_sys->source == p_cb->p_source )
-    { /* DO NOT CLOSE OUR MOTHER STREAM */
-
-        if( vlc_stream_Seek( p_cb->p_source, 0 ) )
+    {  /* DO NOT CLOSE OUR MOTHER STREAM */
+        if( !p_cb->p_sys->b_dead && vlc_stream_Seek( p_cb->p_source, 0 ) )
             return ARCHIVE_FATAL;
     }
     else if( p_cb->p_source )



More information about the vlc-commits mailing list