[vlc-commits] demux: adaptive: fix slow slavedemuxers

Francois Cartegnie git at videolan.org
Fri Jan 20 21:35:04 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan 20 20:54:56 2017 +0100| [7ae1042d16a36d8a6bf8cebf1b691b6134a72ea2] | committer: Francois Cartegnie

demux: adaptive: fix slow slavedemuxers

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

 modules/demux/adaptive/plumbing/Demuxer.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/demux/adaptive/plumbing/Demuxer.cpp b/modules/demux/adaptive/plumbing/Demuxer.cpp
index f44ec19..66f339f 100644
--- a/modules/demux/adaptive/plumbing/Demuxer.cpp
+++ b/modules/demux/adaptive/plumbing/Demuxer.cpp
@@ -155,12 +155,14 @@ bool SlaveDemuxer::create()
 
 int SlaveDemuxer::demux(mtime_t nz_deadline)
 {
-    if( demux_Control(p_demux, DEMUX_SET_NEXT_DEMUX_TIME, VLC_TS_0 + nz_deadline) != VLC_SUCCESS )
+    /* Always call with increment or buffering will get slow stuck */
+    mtime_t i_next_demux_time = VLC_TS_0 + nz_deadline + CLOCK_FREQ / 4;
+    if( demux_Control(p_demux, DEMUX_SET_NEXT_DEMUX_TIME, i_next_demux_time ) != VLC_SUCCESS )
     {
         b_eof = true;
         return VLC_DEMUXER_EOF;
     }
-    int ret = Demuxer::demux(nz_deadline);
-    es_out_Control(p_es_out, ES_OUT_SET_GROUP_PCR, 0, VLC_TS_0 + nz_deadline);
+    int ret = Demuxer::demux(i_next_demux_time);
+    es_out_Control(p_es_out, ES_OUT_SET_GROUP_PCR, 0, i_next_demux_time);
     return ret;
 }



More information about the vlc-commits mailing list