[vlc-commits] demux/adaptive: ensure monotonically increasing PCR

Filip Roséen git at videolan.org
Fri Oct 14 11:16:12 CEST 2016


vlc | branch: master | Filip Roséen <filip at atch.se> | Thu Oct 13 20:30:53 2016 +0200| [65b239041d64384ada0ae73316fce7f6dad09e61] | committer: Francois Cartegnie

demux/adaptive: ensure monotonically increasing PCR

Modified-by: Francois Cartegnie <fcvlcdev at free.fr>
Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>

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

 modules/demux/adaptive/PlaylistManager.cpp | 6 +++---
 modules/demux/adaptive/PlaylistManager.h   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 9662257..58056ce 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -236,7 +236,7 @@ AbstractStream::buffering_status PlaylistManager::bufferize(mtime_t i_nzdeadline
     return i_return;
 }
 
-AbstractStream::status PlaylistManager::dequeue(mtime_t *pi_nzbarrier)
+AbstractStream::status PlaylistManager::dequeue(mtime_t i_floor, mtime_t *pi_nzbarrier)
 {
     AbstractStream::status i_return = AbstractStream::status_eof;
 
@@ -252,7 +252,7 @@ AbstractStream::status PlaylistManager::dequeue(mtime_t *pi_nzbarrier)
         if( i_ret > i_return )
             i_return = i_ret;
 
-        if( i_pcr > VLC_TS_INVALID )
+        if( i_pcr > i_floor )
             *pi_nzbarrier = std::min( *pi_nzbarrier, i_pcr - VLC_TS_0 );
     }
 
@@ -422,7 +422,7 @@ int PlaylistManager::doDemux(int64_t increment)
     mtime_t i_nzbarrier = demux.i_nzpcr + increment;
     vlc_mutex_unlock(&demux.lock);
 
-    AbstractStream::status status = dequeue(&i_nzbarrier);
+    AbstractStream::status status = dequeue(demux.i_nzpcr, &i_nzbarrier);
 
     updateControlsContentType();
     updateControlsPosition();
diff --git a/modules/demux/adaptive/PlaylistManager.h b/modules/demux/adaptive/PlaylistManager.h
index a39371b..ac5a872 100644
--- a/modules/demux/adaptive/PlaylistManager.h
+++ b/modules/demux/adaptive/PlaylistManager.h
@@ -55,7 +55,7 @@ namespace adaptive
             void    stop();
 
             AbstractStream::buffering_status bufferize(mtime_t, unsigned, unsigned);
-            AbstractStream::status dequeue(mtime_t *);
+            AbstractStream::status dequeue(mtime_t, mtime_t *);
             void drain();
 
             virtual bool needsUpdate() const;



More information about the vlc-commits mailing list