[vlc-devel] [PATCH] control: oldrc: make it possible to adjust volume without playback

Filip Roséen filip at atch.se
Wed Jul 25 03:51:15 CEST 2018


I don't know why 33464eacd6e introduced logic to prevent volume change
if the input is either paused, or not at all present, but from a
user's perspective this is not intuitive (as one of course can
adjust the volume even if nothing is playing).

fixes: #20897

---

If anyone was around at the time of that commit, I would be very
interesting in the rationale; history is interesting!
---
 modules/control/oldrc.c | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c
index 4d400e23e7..7a780e868d 100644
--- a/modules/control/oldrc.c
+++ b/modules/control/oldrc.c
@@ -1422,23 +1422,8 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd,
     VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
     intf_thread_t *p_intf = (intf_thread_t*)p_this;
     playlist_t *p_playlist = p_intf->p_sys->p_playlist;
-    input_thread_t *p_input = playlist_CurrentInput( p_playlist );
     int i_error = VLC_EGENERIC;
 
-    if( !p_input )
-        return VLC_ENOOBJ;
-
-    if( p_input )
-    {
-        int state = var_GetInteger( p_input, "state" );
-        vlc_object_release( p_input );
-        if( state == PAUSE_S )
-        {
-            msg_rc( "%s", _("Type 'pause' to continue.") );
-            return VLC_EGENERIC;
-        }
-    }
-
     if ( *newval.psz_string )
     {
         /* Set. */
@@ -1466,22 +1451,9 @@ static int VolumeMove( vlc_object_t *p_this, char const *psz_cmd,
     VLC_UNUSED(oldval); VLC_UNUSED(p_data);
     intf_thread_t *p_intf = (intf_thread_t*)p_this;
     float volume;
-    input_thread_t *p_input =
-        playlist_CurrentInput( p_intf->p_sys->p_playlist );
     int i_nb_steps = atoi(newval.psz_string);
     int i_error = VLC_SUCCESS;
 
-    if( !p_input )
-        return VLC_ENOOBJ;
-
-    int state = var_GetInteger( p_input, "state" );
-    vlc_object_release( p_input );
-    if( state == PAUSE_S )
-    {
-        msg_rc( "%s", _("Type 'pause' to continue.") );
-        return VLC_EGENERIC;
-    }
-
     if( !strcmp(psz_cmd, "voldown") )
         i_nb_steps *= -1;
     if( playlist_VolumeUp( p_intf->p_sys->p_playlist, i_nb_steps, &volume ) < 0 )
-- 
2.18.0


More information about the vlc-devel mailing list