[vlc-commits] demux: adaptive: reactivate stream using playback time, not buffers pcr
Francois Cartegnie
git at videolan.org
Wed May 16 20:03:12 CEST 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May 16 16:18:43 2018 +0200| [1388783c7e4c6037ca2f7bca3d661e2b3173990b] | committer: Francois Cartegnie
demux: adaptive: reactivate stream using playback time, not buffers pcr
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1388783c7e4c6037ca2f7bca3d661e2b3173990b
---
modules/demux/adaptive/PlaylistManager.cpp | 17 ++++-------------
modules/demux/adaptive/PlaylistManager.h | 2 +-
2 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 7bfa277e80..ef69167199 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -305,19 +305,10 @@ void PlaylistManager::drain()
es_out_Control(p_demux->out, ES_OUT_RESET_PCR);
}
-mtime_t PlaylistManager::getPCR() const
+mtime_t PlaylistManager::getResumeTime() const
{
- mtime_t minpcr = VLC_TS_INVALID;
- std::vector<AbstractStream *>::const_iterator it;
- for(it=streams.begin(); it!=streams.end(); ++it)
- {
- const mtime_t pcr = (*it)->getPCR();
- if(minpcr == VLC_TS_INVALID)
- minpcr = pcr;
- else if(pcr != VLC_TS_INVALID)
- minpcr = std::min(minpcr, pcr);
- }
- return minpcr;
+ vlc_mutex_locker locker(const_cast<vlc_mutex_t *>(&demux.lock));
+ return demux.i_nzpcr;
}
mtime_t PlaylistManager::getFirstDTS() const
@@ -422,7 +413,7 @@ void PlaylistManager::pruneLiveStream()
bool PlaylistManager::reactivateStream(AbstractStream *stream)
{
- return stream->reactivate(getPCR());
+ return stream->reactivate(getResumeTime());
}
#define DEMUX_INCREMENT (CLOCK_FREQ / 20)
diff --git a/modules/demux/adaptive/PlaylistManager.h b/modules/demux/adaptive/PlaylistManager.h
index 27f2f57c98..702aef64ee 100644
--- a/modules/demux/adaptive/PlaylistManager.h
+++ b/modules/demux/adaptive/PlaylistManager.h
@@ -76,7 +76,7 @@ namespace adaptive
virtual bool setPosition(mtime_t);
virtual mtime_t getDuration() const;
- mtime_t getPCR() const;
+ mtime_t getResumeTime() const;
mtime_t getFirstDTS() const;
virtual mtime_t getFirstPlaybackTime() const;
More information about the vlc-commits
mailing list