Commit 223ae3b0 authored by Dennis van Amerongen's avatar Dennis van Amerongen

* modules/access_output/shout.c: backport [23317] sync before you shout.

parent 61996eaf
......@@ -343,12 +343,17 @@ static int Write( sout_access_out_t *p_access, block_t *p_buffer )
msg_Err( p_access, "cannot write to stream: %s",
shout_get_error(p_access->p_sys->p_shout) );
/* This can be caused by a server disconnect. Reconnecting might help... */
/* The most common cause seems to be a server disconnect, resulting in a
Socket Error which can only be fixed by closing and reconnecting.
Since we already began with a working connection, the most feasable
approach to get out of this error status is a (timed) reconnect approach. */
shout_close( p_access->p_sys->p_shout );
msg_Warn( p_access, "server unavailable? waiting 30 seconds to reconnect..." );
msleep( 30000000 );
/* Re-open the connection (protocol params have already been set) and re-sync */
if( shout_open( p_access->p_sys->p_shout ) == SHOUTERR_SUCCESS )
{
shout_sync( p_access->p_sys->p_shout );
msg_Warn( p_access, "reconnected to server" );
}
else
......
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