hds_stream->chunks_head = chunk;
}
+
static void* live_thread( void* p )
{
vlc_object_t* p_this = (vlc_object_t*)p;
if( hds_stream->abst_url &&
( isFQUrl( hds_stream->abst_url ) ) )
{
- abst_url = strdup ( hds_stream->abst_url );
+ if( !( abst_url = strdup( hds_stream->abst_url ) ) )
+ return NULL;
}
else
{
server_base,
hds_stream->abst_url ) )
{
- return 0;
+ return NULL;
}
}
{
case XML_READER_STARTELEM:
if( current_element_idx == 0 && element_stack[current_element_idx] == 0 ) {
- element_stack[current_element_idx] = strdup( node );
+ if( !( element_stack[current_element_idx] = strdup( node ) ) )
+ return VLC_ENOMEM;
} else {
- element_stack[++current_element_idx] = strdup( node );
+ if ( !( element_stack[++current_element_idx] = strdup( node ) ) )
+ return VLC_ENOMEM;
}
+
break;
case XML_READER_ENDELEM:
if( ! strcmp( current_element, "bootstrapInfo") ) {
{
if( !strcmp(attr_name, "streamId" ) )
{
- medias[media_idx].stream_id = strdup( attr_value );
+ if( !( medias[media_idx].stream_id = strdup( attr_value ) ) )
+ return VLC_ENOMEM;
}
if( !strcmp(attr_name, "url" ) )
{
- medias[media_idx].media_url = strdup( attr_value );
+ if( !( medias[media_idx].media_url = strdup( attr_value ) ) )
+ return VLC_ENOMEM;
}
if( !strcmp(attr_name, "bootstrapInfoId" ) )
{
- medias[media_idx].bootstrap_id = strdup( attr_value );
+ if( !( medias[media_idx].bootstrap_id = strdup( attr_value ) ) )
+ return VLC_ENOMEM;
}
}
{
if( !strcmp(attr_name, "url" ) )
{
- bootstraps[bootstrap_idx].url = strdup( attr_value );
+ if( !( bootstraps[bootstrap_idx].url = strdup( attr_value ) ) )
+ return VLC_ENOMEM;
}
if( !strcmp(attr_name, "id" ) )
{
- bootstraps[bootstrap_idx].id = strdup( attr_value );
+ if( !( bootstraps[bootstrap_idx].id = strdup( attr_value ) ) )
+ return VLC_ENOMEM;
}
if( !strcmp(attr_name, "profile" ) )
{
- bootstraps[bootstrap_idx].profile = strdup( attr_value );
+ if( !( bootstraps[bootstrap_idx].profile = strdup( attr_value ) ) )
+ return VLC_ENOMEM;
}
}
}
if( current_element &&
! strcmp( element_stack[current_element_idx-1], "manifest" ) )
{
- media_id = strdup( node );
+ if( !( media_id = strdup( node ) ) )
+ return VLC_ENOMEM;
}
}
}
if( medias[i].media_url )
{
- new_stream->url = strdup( medias[i].media_url );
+ if( !(new_stream->url = strdup( medias[i].media_url ) ) )
+ {
+ free(new_stream);
+ return VLC_ENOMEM;
+ }
}
if( ! sys->live )
}
else
{
- new_stream->abst_url = strdup( bootstraps[j].url );
+ if( !(new_stream->abst_url = strdup( bootstraps[j].url ) ) )
+ {
+ free(new_stream);
+ return VLC_ENOMEM;
+ }
}
vlc_array_append( sys->hds_streams, new_stream );
return VLC_SUCCESS;
}
+
static void hds_free( hds_stream_t *p_stream )
{
FREENULL( p_stream->quality_segment_modifier );