[vlc-commits] demux: adaptive: clear eof flag of AbstractStream after seek
Zhao Zhili
git at videolan.org
Wed Oct 25 13:04:05 CEST 2017
vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Tue Oct 24 00:14:26 2017 +0800| [aa4cc953391e93e45c35373735ff161c945cc8e6] | committer: Francois Cartegnie
demux: adaptive: clear eof flag of AbstractStream after seek
Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa4cc953391e93e45c35373735ff161c945cc8e6
---
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 );
More information about the vlc-commits
mailing list