tools: play: fix leaving STDIN in non-blocking mode after exit
authorAntonio Ospite <ao2@ao2.it>
Thu, 22 Mar 2018 10:12:20 +0000 (11:12 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 26 Mar 2018 10:59:56 +0000 (11:59 +0100)
commitcfc1be0d61e7c4c79afbc16873cd3bc38fa55f79
tree7d31518c8054a45d23c37f9de69ed52a5a6e0a33
parentdc527cac62b24c1b622287e4dbe573aa4d057f4d
tools: play: fix leaving STDIN in non-blocking mode after exit

gst-play-1.0 sets STDIN to non-blocking mode to have the input
characters read as soon as they arrive.

However, when gst_play_kb_set_key_handler() gets called from
restore_terminal() it forgets to restore the STDIN blocking status.

This can result in broken behavior for cli command executed in the same
terminal after gst-play-1.0 exited.

It turns out that putting STDIN in non-blocking mode is not even the
proper way to achieve the desired effect, instead VMIN and VTIME in
struct termios should be set to 0.

Let's do that, and don't mess with the STDIN blocking mode now that it's
not necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=794591
tools/gst-play-kb.c