[vlc-commits] Don't reset current HLS segment playback pointer on a failed seek
Chris Smowton
git at videolan.org
Thu May 31 01:26:13 CEST 2012
vlc | branch: master | Chris Smowton <cs448 at cam.ac.uk> | Wed May 30 14:30:54 2012 +0100| [78baddd08043b952cae3ed973b8d7a561c7ba493] | committer: Jean-Baptiste Kempf
Don't reset current HLS segment playback pointer on a failed seek
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=78baddd08043b952cae3ed973b8d7a561c7ba493
---
modules/stream_filter/httplive.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 8690b0a..46aa9ae 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -2354,16 +2354,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++)
{
@@ -2402,7 +2398,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(¤tSegment->lock);
+ segment_RestorePos(currentSegment);
+ vlc_mutex_unlock(¤tSegment->lock);
+
+ /* restore seeked segment to start position */
segment_t *segment = segment_GetSegment(hls, p_sys->playback.segment);
if (segment == NULL)
{
More information about the vlc-commits
mailing list