Commit ed4089a2 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

oldrc: do not report volume twice, always report playlist status

parent 091d9830
...@@ -502,8 +502,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -502,8 +502,6 @@ static void Run( intf_thread_t *p_intf )
input_item_GetURI( input_GetItem( p_input ) ); input_item_GetURI( input_GetItem( p_input ) );
msg_rc( STATUS_CHANGE "( new input: %s )", psz_uri ); msg_rc( STATUS_CHANGE "( new input: %s )", psz_uri );
free( psz_uri ); free( psz_uri );
msg_rc( STATUS_CHANGE "( audio volume: %d )",
(int)config_GetInt( p_intf, "volume" ));
} }
var_AddCallback( p_input, "intf-event", InputEvent, p_intf ); var_AddCallback( p_input, "intf-event", InputEvent, p_intf );
} }
...@@ -1416,13 +1414,22 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1416,13 +1414,22 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
/* Replay the current state of the system. */ /* Replay the current state of the system. */
char *psz_uri = char *psz_uri =
input_item_GetURI( input_GetItem( p_input ) ); input_item_GetURI( input_GetItem( p_input ) );
vlc_object_release( p_input );
if( likely(psz_uri != NULL) )
{
msg_rc( STATUS_CHANGE "( new input: %s )", psz_uri ); msg_rc( STATUS_CHANGE "( new input: %s )", psz_uri );
free( psz_uri ); free( psz_uri );
msg_rc( STATUS_CHANGE "( audio volume: %d )", }
(int)config_GetInt( p_intf, "volume" )); }
float volume = aout_VolumeGet( p_playlist );
if( volume >= 0.f )
msg_rc( STATUS_CHANGE "( audio volume: %ld )",
lroundf(volume * AOUT_VOLUME_DEFAULT) );
int status;
PL_LOCK; PL_LOCK;
int status = playlist_Status(p_playlist); status = playlist_Status(p_playlist);
PL_UNLOCK; PL_UNLOCK;
switch( status ) switch( status )
{ {
...@@ -1439,8 +1446,6 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1439,8 +1446,6 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
msg_rc( STATUS_CHANGE "( unknown state: -1 )" ); msg_rc( STATUS_CHANGE "( unknown state: -1 )" );
break; break;
} }
vlc_object_release( p_input );
}
} }
/* /*
......
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