[vlc-commits] demux: adaptive: modify seekable requirements

Zhao Zhili git at videolan.org
Wed Oct 25 13:04:10 CEST 2017


vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Tue Oct 24 00:14:45 2017 +0800| [dfbd1121c77e8d6a0e66caa484a430ba7368dae4] | committer: Francois Cartegnie

demux: adaptive: modify seekable requirements

Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>

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

 modules/demux/adaptive/Streams.cpp | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index 399c8812dd..4b143a1d3c 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -184,10 +184,23 @@ int AbstractStream::esCount() const
 
 bool AbstractStream::seekAble() const
 {
-    return (demuxer &&
-            !fakeesout->restarting() &&
-            !discontinuity &&
-            !commandsqueue->isDraining() );
+    bool restarting = fakeesout->restarting();
+    bool draining = commandsqueue->isDraining();
+    bool eof = commandsqueue->isEOF();
+
+    msg_Dbg(p_realdemux, "demuxer %p, fakeesout restarting %d, "
+            "discontinuity %d, commandsqueue draining %d, commandsqueue eof %d",
+            static_cast<void *>(demuxer), restarting, discontinuity, draining, eof);
+
+    if(!demuxer || restarting || discontinuity || (!eof && draining))
+    {
+        msg_Warn(p_realdemux, "not seekable");
+        return false;
+    }
+    else
+    {
+        return true;
+    }
 }
 
 bool AbstractStream::isSelected() const



More information about the vlc-commits mailing list