[vlc-commits] demux: adaptive: save buffering status
Francois Cartegnie
git at videolan.org
Wed Sep 21 18:52:31 CEST 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Sep 18 16:51:08 2016 +0200| [7cccb1faf6712932f1beb2bbc1e25077ad820a58] | committer: Francois Cartegnie
demux: adaptive: save buffering status
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7cccb1faf6712932f1beb2bbc1e25077ad820a58
---
modules/demux/adaptive/Streams.cpp | 13 +++++++++++++
modules/demux/adaptive/Streams.hpp | 3 +++
2 files changed, 16 insertions(+)
diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index 68ff4b4..9cbedd6 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -50,6 +50,7 @@ AbstractStream::AbstractStream(demux_t * demux_)
commandsqueue = NULL;
demuxer = NULL;
fakeesout = NULL;
+ last_buffer_status = buffering_lessthanmin;
vlc_mutex_init(&lock);
}
@@ -251,9 +252,21 @@ bool AbstractStream::drain()
return fakeesout->drain();
}
+AbstractStream::buffering_status AbstractStream::getLastBufferStatus() const
+{
+ return last_buffer_status;
+}
+
AbstractStream::buffering_status AbstractStream::bufferize(mtime_t nz_deadline,
unsigned i_min_buffering, unsigned i_extra_buffering)
{
+ last_buffer_status = doBufferize(nz_deadline, i_min_buffering, i_extra_buffering);
+ return last_buffer_status;
+}
+
+AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline,
+ unsigned i_min_buffering, unsigned i_extra_buffering)
+{
vlc_mutex_lock(&lock);
/* Ensure it is configured */
diff --git a/modules/demux/adaptive/Streams.hpp b/modules/demux/adaptive/Streams.hpp
index afd3ba2..df30361 100644
--- a/modules/demux/adaptive/Streams.hpp
+++ b/modules/demux/adaptive/Streams.hpp
@@ -83,6 +83,7 @@ namespace adaptive
buffering_lessthanmin,
} buffering_status;
buffering_status bufferize(mtime_t, unsigned, unsigned);
+ buffering_status getLastBufferStatus() const;
status dequeue(mtime_t, mtime_t *);
bool drain();
virtual bool setPosition(mtime_t, bool);
@@ -125,6 +126,8 @@ namespace adaptive
vlc_mutex_t lock; /* lock for everything accessed by dequeuing */
private:
+ buffering_status doBufferize(mtime_t, unsigned, unsigned);
+ buffering_status last_buffer_status;
bool dead;
bool disabled;
};
More information about the vlc-commits
mailing list