[vlc-commits] demux: adaptive: clear eof flag of CommandsQueue after seek
Zhao Zhili
git at videolan.org
Wed Oct 25 13:04:01 CEST 2017
vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Tue Oct 24 00:14:03 2017 +0800| [e6d3351bfdd3b9d4073674d994bf48132335382f] | committer: Francois Cartegnie
demux: adaptive: clear eof flag of CommandsQueue after seek
Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e6d3351bfdd3b9d4073674d994bf48132335382f
---
modules/demux/adaptive/Streams.cpp | 6 ++++--
modules/demux/adaptive/plumbing/CommandsQueue.cpp | 9 ++++++---
modules/demux/adaptive/plumbing/CommandsQueue.hpp | 2 +-
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index 96543d3187..c5141dca44 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -338,7 +338,7 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
return AbstractStream::buffering_ongoing;
}
dead = true; /* Prevent further retries */
- commandsqueue->setEOF();
+ commandsqueue->setEOF(true);
vlc_mutex_unlock(&lock);
return AbstractStream::buffering_end;
}
@@ -380,7 +380,7 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
vlc_mutex_unlock(&lock);
return AbstractStream::buffering_ongoing;
}
- commandsqueue->setEOF();
+ commandsqueue->setEOF(true);
vlc_mutex_unlock(&lock);
return AbstractStream::buffering_end;
}
@@ -499,6 +499,8 @@ bool AbstractStream::setPosition(mtime_t time, bool tryonly)
if( !restartDemux() )
dead = true;
+ else
+ commandsqueue->setEOF(false);
}
else commandsqueue->Abort( true );
diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.cpp b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
index f2a48b6cec..bd4959d28c 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.cpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
@@ -401,11 +401,14 @@ bool CommandsQueue::isDraining() const
return b;
}
-void CommandsQueue::setEOF()
+void CommandsQueue::setEOF( bool b )
{
vlc_mutex_lock(&lock);
- b_eof = true;
- LockedSetDraining();
+ b_eof = b;
+ if( b_eof )
+ LockedSetDraining();
+ else
+ b_draining = false;
vlc_mutex_unlock(&lock);
}
diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.hpp b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
index 979820e66a..a81d92998d 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.hpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
@@ -160,7 +160,7 @@ namespace adaptive
bool isEmpty() const;
void setDrop( bool );
void setDraining();
- void setEOF();
+ void setEOF( bool );
bool isDraining() const;
bool isEOF() const;
mtime_t getDemuxedAmount() const;
More information about the vlc-commits
mailing list