X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Fplaylist%2Fasx.c;h=02e445b3bf31cc1dd367339538f550ec2a965d18;hb=78be7ca222d06e3cd85d4cc547573371507e7b07;hp=4f990706a93945b6865cf0c16d4561b95690cc96;hpb=4a590357633e5ad7419034bd7f20bf175cc12f45;p=vlc diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c index 4f990706a9..02e445b3bf 100644 --- a/modules/demux/playlist/asx.c +++ b/modules/demux/playlist/asx.c @@ -210,7 +210,8 @@ int Import_ASX( vlc_object_t *p_this ) p_demux->p_sys->psz_data = NULL; p_demux->p_sys->i_data_len = -1; p_demux->p_sys->b_utf8 = false; - p_demux->p_sys->b_skip_ads = config_GetInt( p_demux, "playlist-skip-ads" ); + p_demux->p_sys->b_skip_ads = + var_InheritBool( p_demux, "playlist-skip-ads" ); return VLC_SUCCESS; } @@ -242,7 +243,7 @@ static int Demux( demux_t *p_demux ) int64_t i_pos = 0; p_sys->i_data_len = stream_Size( p_demux->s ) + 1; /* This is a cheat to prevent unnecessary realloc */ if( p_sys->i_data_len <= 0 || p_sys->i_data_len > 16384 ) p_sys->i_data_len = 1024; - p_sys->psz_data = malloc( p_sys->i_data_len +1); + p_sys->psz_data = xmalloc( p_sys->i_data_len +1); /* load the complete file */ for( ;; ) @@ -254,11 +255,14 @@ static int Demux( demux_t *p_demux ) i_pos += i_read; p_sys->i_data_len <<= 1 ; - p_sys->psz_data = realloc( p_sys->psz_data, p_sys->i_data_len * sizeof( char * ) + 1 ); + p_sys->psz_data = xrealloc( p_sys->psz_data, + p_sys->i_data_len * sizeof( char * ) + 1 ); } if( p_sys->i_data_len <= 0 ) return -1; } + input_item_node_t *p_subitems = input_item_node_Create( p_current_input ); + psz_parse = p_sys->psz_data; /* Find first element */ if( ( psz_parse = strcasestr( psz_parse, "" ); + /* counter for single ad item */ + input_item_t *uniq_entry_ad_backup = NULL; + int i_inserted_entries = 0; + while( psz_parse && ( psz_parse = strcasestr( psz_parse, "<" ) ) ) { if( !strncasecmp( psz_parse, "