Commit d3d3c393 authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Jean-Baptiste Kempf

stream_filter/httplive.c: kill some depreceated vlc_object_alive()

(cherry picked from commit 6ae98eec8783f84576fa3bae5bd40b3cee618a97)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent a0b699c9
/***************************************************************************** /*****************************************************************************
* httplive.c: HTTP Live Streaming stream filter * httplive.c: HTTP Live Streaming stream filter
***************************************************************************** *****************************************************************************
* Copyright (C) 2010-2011 M2X BV * Copyright (C) 2010-2012 M2X BV
* $Id$ * $Id$
* *
* Author: Jean-Paul Saman <jpsaman _AT_ videolan _DOT_ org> * Author: Jean-Paul Saman <jpsaman _AT_ videolan _DOT_ org>
...@@ -422,7 +422,7 @@ static int ChooseSegment(stream_t *s, const int current) ...@@ -422,7 +422,7 @@ static int ChooseSegment(stream_t *s, const int current)
int count = vlc_array_count(hls->segments); int count = vlc_array_count(hls->segments);
int i = p_sys->b_live ? count - 1 : 0; int i = p_sys->b_live ? count - 1 : 0;
while((i >= 0) && (i < count) && vlc_object_alive(s)) while((i >= 0) && (i < count))
{ {
segment_t *segment = segment_GetSegment(hls, i); segment_t *segment = segment_GetSegment(hls, i);
assert(segment); assert(segment);
...@@ -1081,7 +1081,7 @@ static int parse_M3U8(stream_t *s, vlc_array_t *streams, uint8_t *buffer, const ...@@ -1081,7 +1081,7 @@ static int parse_M3U8(stream_t *s, vlc_array_t *streams, uint8_t *buffer, const
if (p_begin >= p_end) if (p_begin >= p_end)
break; break;
} while ((err == VLC_SUCCESS) && vlc_object_alive(s)); } while (err == VLC_SUCCESS);
} }
else else
...@@ -1161,7 +1161,7 @@ static int parse_M3U8(stream_t *s, vlc_array_t *streams, uint8_t *buffer, const ...@@ -1161,7 +1161,7 @@ static int parse_M3U8(stream_t *s, vlc_array_t *streams, uint8_t *buffer, const
if (p_begin >= p_end) if (p_begin >= p_end)
break; break;
} while ((err == VLC_SUCCESS) && vlc_object_alive(s)); } while (err == VLC_SUCCESS);
free(line); free(line);
} }
...@@ -2126,9 +2126,8 @@ static segment_t *GetSegment(stream_t *s) ...@@ -2126,9 +2126,8 @@ static segment_t *GetSegment(stream_t *s)
} }
/* Was the HLS stream changed to another bitrate? */ /* Was the HLS stream changed to another bitrate? */
int i_stream = 0;
segment = NULL; segment = NULL;
while(vlc_object_alive(s)) for (int i_stream = 0; i_stream < vlc_array_count(p_sys->hls_stream); i_stream++)
{ {
/* Is the next segment ready */ /* Is the next segment ready */
hls_stream_t *hls = hls_Get(p_sys->hls_stream, i_stream); hls_stream_t *hls = hls_Get(p_sys->hls_stream, i_stream);
...@@ -2160,11 +2159,6 @@ static segment_t *GetSegment(stream_t *s) ...@@ -2160,11 +2159,6 @@ static segment_t *GetSegment(stream_t *s)
if (!p_sys->b_meta) if (!p_sys->b_meta)
break; break;
/* Was the stream changed to another bitrate? */
i_stream++;
if (i_stream >= vlc_array_count(p_sys->hls_stream))
break;
} }
/* */ /* */
return NULL; return NULL;
...@@ -2256,7 +2250,7 @@ static ssize_t hls_Read(stream_t *s, uint8_t *p_read, unsigned int i_read) ...@@ -2256,7 +2250,7 @@ static ssize_t hls_Read(stream_t *s, uint8_t *p_read, unsigned int i_read)
} }
vlc_mutex_unlock(&segment->lock); vlc_mutex_unlock(&segment->lock);
} while ((i_read > 0) && vlc_object_alive(s)); } while (i_read > 0);
return copied; return copied;
} }
...@@ -2339,7 +2333,7 @@ static int Peek(stream_t *s, const uint8_t **pp_peek, unsigned int i_peek) ...@@ -2339,7 +2333,7 @@ static int Peek(stream_t *s, const uint8_t **pp_peek, unsigned int i_peek)
p_buff = peeked->p_buffer; p_buff = peeked->p_buffer;
*pp_peek = p_buff; *pp_peek = p_buff;
while ((curlen < i_peek) && vlc_object_alive(s)) while (curlen < i_peek)
{ {
nsegment = GetSegment(s); nsegment = GetSegment(s);
if (nsegment == NULL) if (nsegment == 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