From 8ecf33f5db7a3c8d3d31335f32e45fd5409640e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
Date: Tue, 28 May 2019 19:20:13 +0300
Subject: [PATCH] rc: split out snapshot command

(and avoid nonsensical string comparison on void variable)
---
 modules/control/oldrc.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c
index bfacb8734418..6dbbb50b5f64 100644
--- a/modules/control/oldrc.c
+++ b/modules/control/oldrc.c
@@ -580,6 +580,12 @@ out:
     vlc_player_Unlock(player);
 }
 
+static void PlayerVoutSnapshot(intf_thread_t *intf, char const *psz_cmd,
+                               vlc_value_t newval)
+{
+    PlayerDoVoid(intf, vlc_player_vout_Snapshot);
+}
+
 static void print_playlist(intf_thread_t *p_intf, vlc_playlist_t *playlist)
 {
     size_t count = vlc_playlist_Count(playlist);
@@ -921,8 +927,6 @@ static void VideoConfig(intf_thread_t *intf, char const *psz_cmd,
         psz_variable = "aspect-ratio";
     else if( !strcmp( psz_cmd, "vzoom" ) )
         psz_variable = "zoom";
-    else if( !strcmp( psz_cmd, "snapshot" ) )
-        psz_variable = "video-snapshot";
     else
         /* This case can't happen */
         vlc_assert_unreachable();
@@ -938,8 +942,6 @@ static void VideoConfig(intf_thread_t *intf, char const *psz_cmd,
         else
             var_SetString( p_vout, psz_variable, newval.psz_string );
     }
-    else if( !strcmp( psz_cmd, "snapshot" ) )
-        vlc_player_vout_Snapshot(player);
     else
     {
         /* get */
@@ -1182,7 +1184,7 @@ static const struct
     { "slower", PlayerSlower },
     { "normal", PlayerNormal },
     { "frame", PlayerFrame },
-    { "snapshot", VideoConfig },
+    { "snapshot", PlayerVoutSnapshot },
 };
 
 static const struct
-- 
GitLab