[vlc-devel] [PATCH 2/5] adaptive: PlaylistManager: fix spurious condition
Alexandre Janniaux
ajanni at videolabs.io
Sun Nov 1 12:34:18 CET 2020
---
modules/demux/adaptive/PlaylistManager.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 447f4b0365..8344de005a 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -445,8 +445,10 @@ int PlaylistManager::doDemux(vlc_tick_t increment)
b_dead &= !(*it)->isValid();
b_all_disabled &= (*it)->isDisabled();
}
- if(!b_dead)
- vlc_cond_timedwait(&demux.cond, &demux.lock, vlc_tick_now() + VLC_TICK_FROM_MS(50));
+ vlc_tick_t deadline = vlc_tick_now() + VLC_TICK_FROM_MS(50);
+ int i_ret = 0;
+ while(!b_dead && i_ret == 0)
+ i_ret = vlc_cond_timedwait(&demux.cond, &demux.lock, deadline);
vlc_mutex_unlock(&demux.lock);
return (b_dead || b_all_disabled) ? AbstractStream::status_eof : AbstractStream::status_buffering;
}
--
2.29.2
More information about the vlc-devel
mailing list