From 0c8967348ff1d894f1ce20ec14f33b0f94e2228c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 26 Feb 2015 10:20:20 +0000 Subject: [PATCH] gst-play: stash current playback rate in app structure https://bugzilla.gnome.org/show_bug.cgi?id=745174 --- tools/gst-play.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/gst-play.c b/tools/gst-play.c index 6800faa0c4..a53c1e6820 100644 --- a/tools/gst-play.c +++ b/tools/gst-play.c @@ -65,6 +65,8 @@ typedef struct /* configuration */ gboolean gapless; + + gdouble rate; } GstPlay; static gboolean quiet = FALSE; @@ -163,6 +165,8 @@ play_new (gchar ** uris, const gchar * audio_sink, const gchar * video_sink, if (initial_volume != -1) play_set_relative_volume (play, initial_volume - 1.0); + play->rate = 1.0; + return play; } @@ -676,7 +680,6 @@ static void keyboard_cb (const gchar * key_input, gpointer user_data) { GstPlay *play = (GstPlay *) user_data; - static gdouble rate = 1.0; switch (g_ascii_tolower (key_input[0])) { case ' ': @@ -696,16 +699,16 @@ keyboard_cb (const gchar * key_input, gpointer user_data) play_prev (play); break; case '+': - rate += 0.5; - change_rate (play, rate); + play->rate += 0.5; + change_rate (play, play->rate); break; case '-': - rate -= 0.5; - change_rate (play, rate); + play->rate -= 0.5; + change_rate (play, play->rate); break; case 'd': - rate *= -1.0; - change_rate (play, rate); + play->rate *= -1.0; + change_rate (play, play->rate); break; case 27: /* ESC */ if (key_input[1] == '\0') {