summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2013-11-29 09:04:20 +0000
committerTim-Philipp Müller <tim@centricular.com>2013-11-29 09:04:20 +0000
commit9011bc1b54ba3f54255b3171f005eda29f7bac5c (patch)
tree6df1291411358646ad9b66383907bcb8e24fca07 /tools
parent1d40b1d2bb68963941720c588bfcc94d6fa3f939 (diff)
tools: gst-play: quit on Q or Esc key
Diffstat (limited to 'tools')
-rw-r--r--tools/gst-play.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/gst-play.c b/tools/gst-play.c
index ec4b33812..7371ace88 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;
}