Commit f67dec7c authored by Dennis van Amerongen's avatar Dennis van Amerongen

* modules/access_output/shout.c: Make ICY the default protocol and set...

* modules/access_output/shout.c: Make ICY the default protocol and set protocol rollover from shoutcast to icecast. This fixes some libshout Socket error messages. Refs #1003. Partly backported from [19745].
parent 5bd24bc3
......@@ -180,8 +180,7 @@ static int Open( vlc_object_t *p_this )
p_shout = p_sys->p_shout = shout_new();
if( !p_shout
|| shout_set_host( p_shout, psz_host ) != SHOUTERR_SUCCESS
|| shout_set_protocol( p_shout, SHOUT_PROTOCOL_HTTP )
!= SHOUTERR_SUCCESS
|| shout_set_protocol( p_shout, SHOUT_PROTOCOL_ICY ) != SHOUTERR_SUCCESS
|| shout_set_port( p_shout, i_port ) != SHOUTERR_SUCCESS
|| shout_set_password( p_shout, psz_pass ) != SHOUTERR_SUCCESS
|| shout_set_mount( p_shout, psz_mount ) != SHOUTERR_SUCCESS
......@@ -189,7 +188,7 @@ static int Open( vlc_object_t *p_this )
|| shout_set_agent( p_shout, "VLC media player " VERSION ) != SHOUTERR_SUCCESS
|| shout_set_name( p_shout, psz_name ) != SHOUTERR_SUCCESS
|| shout_set_description( p_shout, psz_description ) != SHOUTERR_SUCCESS
// || shout_set_nonblocking( p_shout, 1 ) != SHOUTERR_SUCCESS
/* || shout_set_nonblocking( p_shout, 1 ) != SHOUTERR_SUCCESS */
)
{
msg_Err( p_access, "failed to initialize shout streaming to %s:%i/%s",
......@@ -216,10 +215,42 @@ static int Open( vlc_object_t *p_this )
return VLC_EGENERIC;
}
/* Shoutcast using ICY protocol */
i_ret = shout_open( p_shout );
if( i_ret == SHOUTERR_SUCCESS )
{
i_ret = SHOUTERR_CONNECTED;
msg_Dbg( p_access, "connected using 'icy' (shoutcast) protocol" );
}
else
{
msg_Warn( p_access, "failed to connect using 'icy' (shoutcast) protocol" );
/* Shout parameters cannot be changed on an open connection */
i_ret = shout_close( p_shout );
if( i_ret == SHOUTERR_SUCCESS )
{
i_ret = SHOUTERR_UNCONNECTED;
}
/* IceCAST using HTTP protocol */
i_ret = shout_set_protocol( p_shout, SHOUT_PROTOCOL_HTTP );
if( i_ret != SHOUTERR_SUCCESS )
{
msg_Err( p_access, "failed to set the protocol to 'http'" );
free( p_access->p_sys );
free( psz_accessname );
return VLC_EGENERIC;
}
i_ret = shout_open( p_shout );
if( i_ret == SHOUTERR_SUCCESS )
{
i_ret = SHOUTERR_CONNECTED;
msg_Dbg( p_access, "connected using 'http' (icecast 2.x) protocol" );
}
else
msg_Warn( p_access, "failed to connect using 'http' (icecast 2.x) protocol " );
}
/*
......
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