Commit 1e4a68f2 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Fix icecast detection (only works if the server truly is icecast).

parent cbb4bd7c
...@@ -113,6 +113,7 @@ struct access_sys_t ...@@ -113,6 +113,7 @@ struct access_sys_t
char *psz_pragma; char *psz_pragma;
char *psz_location; char *psz_location;
vlc_bool_t b_mms; vlc_bool_t b_mms;
vlc_bool_t b_icecast;
vlc_bool_t b_chunked; vlc_bool_t b_chunked;
int64_t i_chunk; int64_t i_chunk;
...@@ -186,6 +187,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -186,6 +187,7 @@ static int Open( vlc_object_t *p_this )
p_sys->psz_mime = NULL; p_sys->psz_mime = NULL;
p_sys->psz_pragma = NULL; p_sys->psz_pragma = NULL;
p_sys->b_mms = VLC_FALSE; p_sys->b_mms = VLC_FALSE;
p_sys->b_icecast = VLC_FALSE;
p_sys->psz_location = NULL; p_sys->psz_location = NULL;
p_sys->psz_user_agent = NULL; p_sys->psz_user_agent = NULL;
p_sys->b_pace_control = VLC_TRUE; p_sys->b_pace_control = VLC_TRUE;
...@@ -301,6 +303,12 @@ static int Open( vlc_object_t *p_this ) ...@@ -301,6 +303,12 @@ static int Open( vlc_object_t *p_this )
goto error; goto error;
} }
if( p_sys->b_icecast )
{
if( p_sys->psz_mime && !strcasecmp( p_sys->psz_mime, "audio/mpeg" ) )
p_access->psz_demux = strdup( "mp3" );
}
if( !strcmp( p_sys->psz_protocol, "ICY" ) ) if( !strcmp( p_sys->psz_protocol, "ICY" ) )
{ {
if( p_sys->psz_mime && !strcasecmp( p_sys->psz_mime, "video/nsv" ) ) if( p_sys->psz_mime && !strcasecmp( p_sys->psz_mime, "video/nsv" ) )
...@@ -794,12 +802,15 @@ static int Connect( access_t *p_access, int64_t i_tell ) ...@@ -794,12 +802,15 @@ static int Connect( access_t *p_access, int64_t i_tell )
p_sys->psz_pragma = strdup( p ); p_sys->psz_pragma = strdup( p );
msg_Dbg( p_access, "Pragma: %s", p_sys->psz_pragma ); msg_Dbg( p_access, "Pragma: %s", p_sys->psz_pragma );
} }
else if( !strcasecmp( psz, "Server" ) && else if( !strcasecmp( psz, "Server" ) )
!strncasecmp( p, "Icecast", 7 ) )
{ {
p_sys->b_reconnect = VLC_TRUE;
p_sys->b_pace_control = VLC_FALSE;
msg_Dbg( p_access, "Server: %s", p ); msg_Dbg( p_access, "Server: %s", p );
if( !strncasecmp( p, "Icecast", 7 ) )
{
p_sys->b_reconnect = VLC_TRUE;
p_sys->b_pace_control = VLC_FALSE;
p_sys->b_icecast = VLC_TRUE;
}
} }
else if( !strcasecmp( psz, "Transfer-Encoding" ) ) else if( !strcasecmp( psz, "Transfer-Encoding" ) )
{ {
......
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