#include <vlc_url.h>
#include <vlc_tls.h>
#include <vlc_strings.h>
+#include <vlc_charset.h>
#include <vlc_input.h>
#include <vlc_md5.h>
vlc_module_begin();
set_description( N_("HTTP input") );
set_capability( "access", 0 );
- set_shortname( "HTTP(S)" );
+ set_shortname( N_( "HTTP(S)" ) );
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_ACCESS );
int64_t i_chunk;
int i_icy_meta;
+ int64_t i_icy_offset;
char *psz_icy_name;
char *psz_icy_genre;
char *psz_icy_title;
p_sys->p_tls = NULL;
p_sys->p_vs = NULL;
p_sys->i_icy_meta = 0;
+ p_sys->i_icy_offset = 0;
p_sys->psz_icy_name = NULL;
p_sys->psz_icy_genre = NULL;
p_sys->psz_icy_title = NULL;
}
- if( p_sys->i_icy_meta > 0 && p_access->info.i_pos > 0 )
+ if( p_sys->i_icy_meta > 0 && p_access->info.i_pos-p_sys->i_icy_offset > 0 )
{
int64_t i_next = p_sys->i_icy_meta -
- p_access->info.i_pos % p_sys->i_icy_meta;
+ (p_access->info.i_pos - p_sys->i_icy_offset ) % p_sys->i_icy_meta;
if( i_next == p_sys->i_icy_meta )
{
strcmp( p_sys->psz_icy_title, &p[1] ) )
{
free( p_sys->psz_icy_title );
- p_sys->psz_icy_title = strdup( &p[1] );
+ p_sys->psz_icy_title = EnsureUTF8( strdup( &p[1] ));
p_access->info.i_update |= INPUT_UPDATE_META;
msg_Dbg( p_access, "New Title=%s", p_sys->psz_icy_title );
p_sys->b_chunked = false;
p_sys->i_chunk = 0;
p_sys->i_icy_meta = 0;
+ p_sys->i_icy_offset = i_tell;
p_sys->psz_icy_name = NULL;
p_sys->psz_icy_genre = NULL;
p_sys->psz_icy_title = NULL;
else if( !strcasecmp( psz, "Icy-Name" ) )
{
free( p_sys->psz_icy_name );
- p_sys->psz_icy_name = strdup( p );
+ p_sys->psz_icy_name = EnsureUTF8( strdup( p ));
msg_Dbg( p_access, "Icy-Name: %s", p_sys->psz_icy_name );
p_sys->b_icecast = true; /* be on the safeside. set it here as well. */
else if( !strcasecmp( psz, "Icy-Genre" ) )
{
free( p_sys->psz_icy_genre );
- p_sys->psz_icy_genre = strdup( p );
+ p_sys->psz_icy_genre = EnsureUTF8( strdup( p ));
msg_Dbg( p_access, "Icy-Genre: %s", p_sys->psz_icy_genre );
}
else if( !strncasecmp( psz, "Icy-Notice", 10 ) )