From 9011bc1b54ba3f54255b3171f005eda29f7bac5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 29 Nov 2013 09:04:20 +0000 Subject: [PATCH] tools: gst-play: quit on Q or Esc key --- tools/gst-play.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/gst-play.c b/tools/gst-play.c index ec4b338129..7371ace88a 100644 --- a/tools/gst-play.c +++ b/tools/gst-play.c @@ -550,6 +550,10 @@ keyboard_cb (const gchar * key_input, gpointer user_data) case ' ': toggle_paused (play); break; + case 'q': + case 'Q': + g_main_loop_quit (play->loop); + break; case '>': if (!play_next (play)) { g_print ("\nReached end of play list.\n"); @@ -560,6 +564,11 @@ keyboard_cb (const gchar * key_input, gpointer user_data) play_prev (play); break; case 27: /* ESC */ + if (key_input[1] == '\0') { + g_main_loop_quit (play->loop); + break; + } + /* fall through */ default: if (strcmp (key_input, GST_PLAY_KB_ARROW_RIGHT) == 0) { relative_seek (play, +0.08); @@ -681,5 +690,6 @@ main (int argc, char **argv) /* clean up */ play_free (play); + g_print ("\n"); return 0; }