Commit a8a12cbd authored by Chris Smowton's avatar Chris Smowton Committed by Jean-Baptiste Kempf

hls: Fixing backward seek

Fixes #6261
Signed-off-by: default avatarHugo Beauzée-Luyssen <beauze.h@gmail.com>
(cherry picked from commit 0307c51edc4a04f9ef28c1806941483fd280578a)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 29742a51
......@@ -2392,14 +2392,12 @@ static int segment_Seek(stream_t *s, const uint64_t pos)
vlc_mutex_lock(&p_sys->download.lock_wait);
p_sys->download.seek = p_sys->playback.segment;
vlc_cond_signal(&p_sys->download.wait);
vlc_mutex_unlock(&p_sys->download.lock_wait);
/* Wait for download to be finished */
vlc_mutex_lock(&p_sys->download.lock_wait);
msg_Info(s, "seek to segment %d", p_sys->playback.segment);
while (((p_sys->download.seek != -1) ||
(p_sys->download.segment - p_sys->playback.segment < 3)) &&
(p_sys->download.segment < (count - 6)))
while ((p_sys->download.seek != -1) ||
((p_sys->download.segment - p_sys->playback.segment < 3) &&
(p_sys->download.segment < count)))
{
vlc_cond_wait(&p_sys->download.wait, &p_sys->download.lock_wait);
if (!vlc_object_alive(s) || s->b_error) break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment