[vlc-commits] demux: adaptive: fix setPosition
Zhao Zhili
git at videolan.org
Thu Nov 16 13:39:00 CET 2017
vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Sat Nov 11 19:55:19 2017 +0800| [d444322f1fd8b1ed24cf8610b28cf5a31756885e] | committer: Francois Cartegnie
demux: adaptive: fix setPosition
If there is no valid streams, setPosition should not return
true/success. This can happen when DEMUX_SET_TIME failed which lead to
all streams disabled, and then try DEMUX_SET_POSITION.
Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d444322f1fd8b1ed24cf8610b28cf5a31756885e
---
modules/demux/adaptive/PlaylistManager.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 95c817715e..700fa3a8d3 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -346,6 +346,7 @@ mtime_t PlaylistManager::getDuration() const
bool PlaylistManager::setPosition(mtime_t time)
{
bool ret = true;
+ bool hasValidStream = false;
for(int real = 0; real < 2; real++)
{
/* Always probe if we can seek first */
@@ -354,11 +355,19 @@ bool PlaylistManager::setPosition(mtime_t time)
{
AbstractStream *st = *it;
if(!st->isDisabled())
+ {
+ hasValidStream = true;
ret &= st->setPosition(time, !real);
+ }
}
if(!ret)
break;
}
+ if(!hasValidStream)
+ {
+ msg_Warn(p_demux, "there is no valid streams");
+ ret = false;
+ }
return ret;
}
More information about the vlc-commits
mailing list