[vlc-commits] demux: adaptative: add setPosition by segment number
Francois Cartegnie
git at videolan.org
Wed Sep 23 21:15:09 CEST 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Sep 22 22:47:04 2015 +0200| [22d7d9750cad1584576df9f9bef4d2b6e9b65449] | committer: Francois Cartegnie
demux: adaptative: add setPosition by segment number
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=22d7d9750cad1584576df9f9bef4d2b6e9b65449
---
modules/demux/adaptative/SegmentTracker.cpp | 25 ++++++++++++++-----------
modules/demux/adaptative/Streams.cpp | 2 +-
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/modules/demux/adaptative/SegmentTracker.cpp b/modules/demux/adaptative/SegmentTracker.cpp
index ecc3f7d..360362f 100644
--- a/modules/demux/adaptative/SegmentTracker.cpp
+++ b/modules/demux/adaptative/SegmentTracker.cpp
@@ -133,28 +133,31 @@ SegmentChunk * SegmentTracker::getNextChunk(bool switch_allowed)
return chunk;
}
-bool SegmentTracker::setPosition(mtime_t time, bool restarted, bool tryonly)
+bool SegmentTracker::setPositionByTime(mtime_t time, bool restarted, bool tryonly)
{
uint64_t segnumber;
if(prevRepresentation &&
prevRepresentation->getSegmentNumberByTime(time, &segnumber))
{
if(!tryonly)
- {
- if(restarted)
- {
- initializing = true;
- index_sent = false;
- init_sent = false;
- }
- count = segnumber;
- sequence_set = true;
- }
+ setPositionByNumber(segnumber, restarted);
return true;
}
return false;
}
+void SegmentTracker::setPositionByNumber(uint64_t segnumber, bool restarted)
+{
+ if(restarted)
+ {
+ initializing = true;
+ index_sent = false;
+ init_sent = false;
+ }
+ count = segnumber;
+ sequence_set = true;
+}
+
mtime_t SegmentTracker::getSegmentStart() const
{
if(prevRepresentation && sequence_set)
diff --git a/modules/demux/adaptative/Streams.cpp b/modules/demux/adaptative/Streams.cpp
index 5158f70..ea373d5 100644
--- a/modules/demux/adaptative/Streams.cpp
+++ b/modules/demux/adaptative/Streams.cpp
@@ -287,7 +287,7 @@ bool Stream::setPosition(mtime_t time, bool tryonly)
if(!output)
return false;
- bool ret = segmentTracker->setPosition(time, output->reinitsOnSeek(), tryonly);
+ bool ret = segmentTracker->setPositionByTime(time, output->reinitsOnSeek(), tryonly);
if(!tryonly && ret)
{
output->setPosition(time);
More information about the vlc-commits
mailing list