/*****************************************************************************
* raop.c: Remote Audio Output Protocol streaming support
*****************************************************************************
- * Copyright (C) 2008 the VideoLAN team
+ * Copyright (C) 2008 VLC authors and VideoLAN
* $Id$
*
* Author: Michael Hanselmann
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
add_shortcut( "raop" )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
- add_string( SOUT_CFG_PREFIX "host", "", NULL,
+ add_string( SOUT_CFG_PREFIX "host", "",
HOST_TEXT, HOST_LONGTEXT, false )
- add_password( SOUT_CFG_PREFIX "password", NULL, NULL,
+ add_password( SOUT_CFG_PREFIX "password", NULL,
PASSWORD_TEXT, PASSWORD_LONGTEXT, false )
- add_file( SOUT_CFG_PREFIX "password-file", NULL, NULL,
+ add_loadfile( SOUT_CFG_PREFIX "password-file", NULL,
PASSWORD_FILE_TEXT, PASSWORD_FILE_LONGTEXT, false )
- add_integer_with_range( SOUT_CFG_PREFIX "volume", 100, 0, 255, NULL,
+ add_integer_with_range( SOUT_CFG_PREFIX "volume", 100, 0, 255,
VOLUME_TEXT, VOLUME_LONGTEXT, false )
set_callbacks( Open, Close )
vlc_module_end()
char *psz_newline;
char ps_buffer[256];
- p_file = utf8_fopen( psz_path, "rt" );
+ p_file = vlc_fopen( psz_path, "rt" );
if ( p_file == NULL )
{
msg_Err( p_this, "Unable to open password file '%s': %m", psz_path );
*psz_newline = '\0';
}
- if ( strlen( ps_buffer ) == 0 ) {
+ if ( *ps_buffer == '\0' ) {
msg_Err( p_this, "No password could be read from '%s'", psz_path );
goto error;
}
/* Our volume is 0..255, RAOP is -144..0 (-144 off, -30..0 on) */
/* Limit range */
- p_sys->i_volume = __MAX( 0, __MIN( p_sys->i_volume, 255 ) );
+ p_sys->i_volume = VLC_CLIP( p_sys->i_volume, 0, 255 );
if ( p_sys->i_volume == 0 )
d_volume = -144.0;
goto error;
}
- p_stream->p_sys = p_sys;
p_stream->pf_add = Add;
p_stream->pf_del = Del;
p_stream->pf_send = Send;
- p_stream->p_sout->i_out_pace_nocontrol++;
+ p_stream->p_sys = p_sys;
+ p_stream->pace_nocontrol = true;
p_sys->i_control_fd = -1;
p_sys->i_stream_fd = -1;
SendTeardown( p_this );
FreeSys( p_this, p_sys );
-
- p_stream->p_sout->i_out_pace_nocontrol--;
}