vlc | branch: master | Francois Cartegnie <[email protected]> | Sun Jun 23 
22:15:12 2019 +0200| [7ee46b35512501d7a81ee6e9082717a30c007a1f] | committer: 
Francois Cartegnie

demux: adaptive: ignore explicit discontinuities on seek/start

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

 modules/demux/adaptive/Streams.cpp | 11 +++++++++++
 modules/demux/adaptive/Streams.hpp |  1 +
 2 files changed, 12 insertions(+)

diff --git a/modules/demux/adaptive/Streams.cpp 
b/modules/demux/adaptive/Streams.cpp
index 1ad8815d56..bdcc73687b 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -51,6 +51,7 @@ AbstractStream::AbstractStream(demux_t * demux_)
     discontinuity = false;
     needrestart = false;
     inrestart = false;
+    demuxfirstchunk = false;
     segmentTracker = NULL;
     demuxersource = NULL;
     demuxer = NULL;
@@ -236,6 +237,7 @@ bool AbstractStream::startDemux()
     if(!demuxer && format != StreamFormat())
         msg_Err(p_realdemux, "Failed to create demuxer %p %s", (void *)demuxer,
                 format.str().c_str());
+    demuxfirstchunk = true;
 
     return !!demuxer;
 }
@@ -475,6 +477,12 @@ block_t * AbstractStream::readNextBlock()
     if (currentChunk == NULL && !eof)
         currentChunk = 
segmentTracker->getNextChunk(!fakeEsOut()->restarting(), connManager);
 
+    if(discontinuity && demuxfirstchunk)
+    {
+        /* clear up discontinuity on demux start (discontinuity on start 
segment bug) */
+        discontinuity = false;
+    }
+
     if(discontinuity || needrestart)
     {
         msg_Info(p_realdemux, "Encountered discontinuity");
@@ -504,6 +512,8 @@ block_t * AbstractStream::readNextBlock()
     }
     else notfound_sequence = 0;
 
+    demuxfirstchunk = false;
+
     if (currentChunk->isEmpty())
     {
         delete currentChunk;
@@ -526,6 +536,7 @@ bool AbstractStream::setPosition(vlc_tick_t time, bool 
tryonly)
     {
         // clear eof flag before restartDemux() to prevent readNextBlock() fail
         eof = false;
+        demuxfirstchunk = true;
         notfound_sequence = 0;
         if(b_needs_restart)
         {
diff --git a/modules/demux/adaptive/Streams.hpp 
b/modules/demux/adaptive/Streams.hpp
index 3b3d88d61b..5e7d2877f0 100644
--- a/modules/demux/adaptive/Streams.hpp
+++ b/modules/demux/adaptive/Streams.hpp
@@ -116,6 +116,7 @@ namespace adaptive
         bool discontinuity;
         bool needrestart;
         bool inrestart;
+        bool demuxfirstchunk;
 
         demux_t *p_realdemux;
         StreamFormat format;

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to