[vlc-commits] demux: adaptive: forward min buffering level through event
Francois Cartegnie
git at videolan.org
Wed Apr 19 11:00:00 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr 18 18:28:12 2017 +0200| [f39891f1ae51098f4b6dc1ba13de3194c7017514] | committer: Francois Cartegnie
demux: adaptive: forward min buffering level through event
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f39891f1ae51098f4b6dc1ba13de3194c7017514
---
modules/demux/adaptive/SegmentTracker.cpp | 7 ++++---
modules/demux/adaptive/SegmentTracker.hpp | 5 +++--
modules/demux/adaptive/Streams.cpp | 4 ++--
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/modules/demux/adaptive/SegmentTracker.cpp b/modules/demux/adaptive/SegmentTracker.cpp
index 168acd9a25..d5b849375e 100644
--- a/modules/demux/adaptive/SegmentTracker.cpp
+++ b/modules/demux/adaptive/SegmentTracker.cpp
@@ -60,9 +60,10 @@ SegmentTrackerEvent::SegmentTrackerEvent(const ID &id, bool enabled)
u.buffering.id = &id;
}
-SegmentTrackerEvent::SegmentTrackerEvent(const ID &id, mtime_t current, mtime_t target)
+SegmentTrackerEvent::SegmentTrackerEvent(const ID &id, mtime_t min, mtime_t current, mtime_t target)
{
type = BUFFERING_LEVEL_CHANGE;
+ u.buffering_level.minimum = min;
u.buffering_level.current = current;
u.buffering_level.target = target;
u.buffering.id = &id;
@@ -337,9 +338,9 @@ void SegmentTracker::notifyBufferingState(bool enabled) const
notify(SegmentTrackerEvent(adaptationSet->getID(), enabled));
}
-void SegmentTracker::notifyBufferingLevel(mtime_t current, mtime_t target) const
+void SegmentTracker::notifyBufferingLevel(mtime_t min, mtime_t current, mtime_t target) const
{
- notify(SegmentTrackerEvent(adaptationSet->getID(), current, target));
+ notify(SegmentTrackerEvent(adaptationSet->getID(), min, current, target));
}
void SegmentTracker::registerListener(SegmentTrackerListenerInterface *listener)
diff --git a/modules/demux/adaptive/SegmentTracker.hpp b/modules/demux/adaptive/SegmentTracker.hpp
index e5b6f5a1c8..2c1f7ccb91 100644
--- a/modules/demux/adaptive/SegmentTracker.hpp
+++ b/modules/demux/adaptive/SegmentTracker.hpp
@@ -57,7 +57,7 @@ namespace adaptive
SegmentTrackerEvent(BaseRepresentation *, BaseRepresentation *);
SegmentTrackerEvent(const StreamFormat *);
SegmentTrackerEvent(const ID &, bool);
- SegmentTrackerEvent(const ID &, mtime_t, mtime_t);
+ SegmentTrackerEvent(const ID &, mtime_t, mtime_t, mtime_t);
SegmentTrackerEvent(const ID &, mtime_t);
enum
{
@@ -91,6 +91,7 @@ namespace adaptive
struct
{
const ID *id;
+ mtime_t minimum;
mtime_t current;
mtime_t target;
} buffering_level;
@@ -123,7 +124,7 @@ namespace adaptive
mtime_t getPlaybackTime() const; /* Current segment start time if selected */
mtime_t getMinAheadTime() const;
void notifyBufferingState(bool) const;
- void notifyBufferingLevel(mtime_t, mtime_t) const;
+ void notifyBufferingLevel(mtime_t, mtime_t, mtime_t) const;
void registerListener(SegmentTrackerListenerInterface *);
void updateSelected();
diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index 77c2aa3a2e..00bf83bc63 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -342,7 +342,7 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
const int64_t i_total_buffering = i_min_buffering + i_extra_buffering;
mtime_t i_demuxed = commandsqueue->getDemuxedAmount();
- segmentTracker->notifyBufferingLevel(i_demuxed, i_total_buffering);
+ segmentTracker->notifyBufferingLevel(i_min_buffering, i_demuxed, i_total_buffering);
if(i_demuxed < i_total_buffering) /* not already demuxed */
{
if(!segmentTracker->segmentsListReady()) /* Live Streams */
@@ -380,7 +380,7 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
return AbstractStream::buffering_end;
}
i_demuxed = commandsqueue->getDemuxedAmount();
- segmentTracker->notifyBufferingLevel(i_demuxed, i_total_buffering);
+ segmentTracker->notifyBufferingLevel(i_min_buffering, i_demuxed, i_total_buffering);
}
vlc_mutex_unlock(&lock);
More information about the vlc-commits
mailing list