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

Don't reset current HLS segment playback pointer on a failed seek

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 78baddd08043b952cae3ed973b8d7a561c7ba493)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 0879b3f6
......@@ -2350,16 +2350,12 @@ static int segment_Seek(stream_t *s, const uint64_t pos)
uint64_t size = hls->size;
int count = vlc_array_count(hls->segments);
/* restore current segment to start position */
segment_t *segment = segment_GetSegment(hls, p_sys->playback.segment);
if (segment == NULL)
segment_t *currentSegment = segment_GetSegment(hls, p_sys->playback.segment);
if (currentSegment == NULL)
{
vlc_mutex_unlock(&hls->lock);
return VLC_EGENERIC;
}
vlc_mutex_lock(&segment->lock);
segment_RestorePos(segment);
vlc_mutex_unlock(&segment->lock);
for (int n = 0; n < count; n++)
{
......@@ -2398,7 +2394,13 @@ static int segment_Seek(stream_t *s, const uint64_t pos)
/* */
if (b_found)
{
/* restore segment to start position */
/* restore current segment to start position */
vlc_mutex_lock(&currentSegment->lock);
segment_RestorePos(currentSegment);
vlc_mutex_unlock(&currentSegment->lock);
/* restore seeked segment to start position */
segment_t *segment = segment_GetSegment(hls, p_sys->playback.segment);
if (segment == NULL)
{
......
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