[vlc-devel] [PATCH 3/5] demux: adaptive: clear eof flag of AbstractStream after seek
Zhao Zhili
quinkblack at foxmail.com
Mon Oct 23 18:14:26 CEST 2017
---
modules/demux/adaptive/Streams.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index c5141dca44..399c8812dd 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -487,6 +487,8 @@ bool AbstractStream::setPosition(mtime_t time, bool tryonly)
bool ret = segmentTracker->setPositionByTime(time, demuxer->needsRestartOnSeek(), tryonly);
if(!tryonly && ret)
{
+ // clear eof flag before restartDemux() to prevent readNextBlock() fail
+ eof = false;
if(demuxer->needsRestartOnSeek())
{
if(currentChunk)
@@ -498,9 +500,16 @@ bool AbstractStream::setPosition(mtime_t time, bool tryonly)
setTimeOffset(segmentTracker->getPlaybackTime());
if( !restartDemux() )
+ {
+ msg_Info(p_realdemux, "Restart demux failed");
+ eof = true;
dead = true;
+ ret = false;
+ }
else
+ {
commandsqueue->setEOF(false);
+ }
}
else commandsqueue->Abort( true );
--
2.14.2
More information about the vlc-devel
mailing list