tools: gst-play: quit on Q or Esc key

This commit is contained in:
Tim-Philipp Müller 2013-11-29 09:04:20 +00:00
parent 1d40b1d2bb
commit 9011bc1b54

View file

@ -550,6 +550,10 @@ keyboard_cb (const gchar * key_input, gpointer user_data)
case ' ': case ' ':
toggle_paused (play); toggle_paused (play);
break; break;
case 'q':
case 'Q':
g_main_loop_quit (play->loop);
break;
case '>': case '>':
if (!play_next (play)) { if (!play_next (play)) {
g_print ("\nReached end of play list.\n"); g_print ("\nReached end of play list.\n");
@ -560,6 +564,11 @@ keyboard_cb (const gchar * key_input, gpointer user_data)
play_prev (play); play_prev (play);
break; break;
case 27: /* ESC */ case 27: /* ESC */
if (key_input[1] == '\0') {
g_main_loop_quit (play->loop);
break;
}
/* fall through */
default: default:
if (strcmp (key_input, GST_PLAY_KB_ARROW_RIGHT) == 0) { if (strcmp (key_input, GST_PLAY_KB_ARROW_RIGHT) == 0) {
relative_seek (play, +0.08); relative_seek (play, +0.08);
@ -681,5 +690,6 @@ main (int argc, char **argv)
/* clean up */ /* clean up */
play_free (play); play_free (play);
g_print ("\n");
return 0; return 0;
} }