Await video in get_video() if we are suspended.
authorCarl Hetherington <cth@carlh.net>
Wed, 22 Aug 2018 21:00:11 +0000 (22:00 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 22 Aug 2018 21:00:11 +0000 (22:00 +0100)
commit43b8c87f18793d57a9752f360614a5640dad9810
tree53609e046bc273c87ee68719e160db7c55c988be
parent2571104b6a208fa00b2c98d50f97849c3e7fa6c9
Await video in get_video() if we are suspended.

Fix player_change to summon the butler if _suspended is changed, and
ensure that the butler's Player::Change handler is the first to be
called so that suspension is sorted out before any other
Player::Change handlers might call get_video().

This is to prevent the sequence

1. player change-pending emitted
2. hence butler suspended -> 1
3. player change-done emitted
4. first handler is something which calls get_video()
5. get_video() awaits video which will never arrive because the butler
is suspended.

Here there is a pending change-done signal to butler.  Ensuring this
arrives before the handler which calls get_video() sorts it out.
src/lib/butler.cc