[vlc-commits] demux: adaptive: fix early fail handling

Francois Cartegnie git at videolan.org
Fri Jul 15 18:21:14 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jul 15 18:17:39 2016 +0200| [84d42581a8ad7bfe98bd1be7d2a3b18d5567e77f] | committer: Francois Cartegnie

demux: adaptive: fix early fail handling

if no pcr was set (no valid demux or stream), never stopped

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

 modules/demux/adaptive/PlaylistManager.cpp |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 1b78e56..cb61ede 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -385,9 +385,14 @@ int PlaylistManager::doDemux(int64_t increment)
     vlc_mutex_lock(&demux.lock);
     if(demux.i_nzpcr == VLC_TS_INVALID)
     {
-        vlc_cond_timedwait(&demux.cond, &demux.lock, mdate() + CLOCK_FREQ / 20);
+        bool b_dead = true;
+        std::vector<AbstractStream *>::const_iterator it;
+        for(it=streams.begin(); it!=streams.end(); ++it)
+            b_dead &= (*it)->isDead();
+        if(!b_dead)
+            vlc_cond_timedwait(&demux.cond, &demux.lock, mdate() + CLOCK_FREQ / 20);
         vlc_mutex_unlock(&demux.lock);
-        return AbstractStream::status_buffering;
+        return (b_dead) ? AbstractStream::status_eof : AbstractStream::status_buffering;
     }
 
     if(demux.i_firstpcr == VLC_TS_INVALID)



More information about the vlc-commits mailing list