static bool ReadCommand( intf_thread_t *, char *, int * );
-static input_item_t *parse_MRL( intf_thread_t *, char * );
+static input_item_t *parse_MRL( const char * );
static int Input ( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
else if( !strcmp( psz_cmd, "add" ) &&
newval.psz_string && *newval.psz_string )
{
- input_item_t *p_item = parse_MRL( p_intf, newval.psz_string );
+ input_item_t *p_item = parse_MRL( newval.psz_string );
if( p_item )
{
else if( !strcmp( psz_cmd, "enqueue" ) &&
newval.psz_string && *newval.psz_string )
{
- input_item_t *p_item = parse_MRL( p_intf, newval.psz_string );
+ input_item_t *p_item = parse_MRL( newval.psz_string );
if( p_item )
{
{
/* Set. */
audio_volume_t i_volume = atoi( newval.psz_string );
- if ( (i_volume > (audio_volume_t)AOUT_VOLUME_MAX) )
- {
- msg_rc( "Volume must be in the range 0-%d.", AOUT_VOLUME_MAX );
- i_error = VLC_EBADVAR;
- }
- else
- {
- if( i_volume == 0 )
- aout_ToggleMute( p_playlist, NULL );
- if( !aout_VolumeSet( p_playlist, i_volume ) )
- i_error = VLC_SUCCESS;
- osd_Volume( p_this );
- msg_rc( STATUS_CHANGE "( audio volume: %d )", i_volume );
- }
+ if( i_volume == 0 )
+ aout_ToggleMute( p_playlist, NULL );
+ if( !aout_VolumeSet( p_playlist, i_volume ) )
+ i_error = VLC_SUCCESS;
+ osd_Volume( p_this );
+ msg_rc( STATUS_CHANGE "( audio volume: %d )", i_volume );
}
else
{
playlist_CurrentInput( p_intf->p_sys->p_playlist );
int i_nb_steps = atoi(newval.psz_string);
int i_error = VLC_SUCCESS;
- int i_volume_step = 0;
if( !p_input )
return VLC_ENOOBJ;
return VLC_EGENERIC;
}
- i_volume_step = config_GetInt( p_intf->p_libvlc, "volume-step" );
- if ( i_nb_steps <= 0 || i_nb_steps > (AOUT_VOLUME_MAX/i_volume_step) )
- {
- i_nb_steps = 1;
- }
-
if( !strcmp(psz_cmd, "voldown") )
i_nb_steps *= -1;
if( aout_VolumeUp( p_intf->p_sys->p_playlist, i_nb_steps, &i_volume ) < 0 )
* We don't check for '"' or '\'', we just assume that a ':' that follows a
* space is a new option. Should be good enough for our purpose.
*****************************************************************************/
-static input_item_t *parse_MRL( intf_thread_t *p_intf, char *psz_mrl )
+static input_item_t *parse_MRL( const char *mrl )
{
#define SKIPSPACE( p ) { while( *p == ' ' || *p == '\t' ) p++; }
#define SKIPTRAILINGSPACE( p, d ) \
{ char *e=d; while( e > p && (*(e-1)==' ' || *(e-1)=='\t') ){e--;*e=0;} }
input_item_t *p_item = NULL;
- char *psz_item = NULL, *psz_item_mrl = NULL, *psz_orig;
+ char *psz_item = NULL, *psz_item_mrl = NULL, *psz_orig, *psz_mrl;
char **ppsz_options = NULL;
int i, i_options = 0;
- if( !psz_mrl ) return 0;
+ if( !mrl ) return 0;
- psz_mrl = psz_orig = strdup( psz_mrl );
+ psz_mrl = psz_orig = strdup( mrl );
if( !psz_mrl )
return NULL;
while( *psz_mrl )