while it's suspended. Then make the GUI follow that suggestion.
Should
}
pair<shared_ptr<PlayerVideo>, DCPTime>
-Butler::get_video ()
+Butler::get_video (Error* e)
{
boost::mutex::scoped_lock lm (_mutex);
+ if (_suspended) {
+ if (e) {
+ *e = AGAIN;
+ }
+ return make_pair(shared_ptr<PlayerVideo>(), DCPTime());
+ }
+
/* Wait for data if we have none */
while (_video.empty() && !_finished && !_died) {
_arrived.wait (lm);
}
if (_video.empty()) {
- return make_pair (shared_ptr<PlayerVideo>(), DCPTime());
+ if (e) {
+ *e = NONE;
+ }
+ return make_pair(shared_ptr<PlayerVideo>(), DCPTime());
}
pair<shared_ptr<PlayerVideo>, DCPTime> const r = _video.get ();
~Butler ();
void seek (DCPTime position, bool accurate);
- std::pair<boost::shared_ptr<PlayerVideo>, DCPTime> get_video ();
+
+ enum Error {
+ NONE,
+ AGAIN
+ };
+
+ std::pair<boost::shared_ptr<PlayerVideo>, DCPTime> get_video (Error* e = 0);
boost::optional<DCPTime> get_audio (float* out, Frame frames);
boost::optional<TextRingBuffers::Data> get_closed_caption ();
DCPOMATIC_ASSERT (_butler);
do {
- _player_video = _butler->get_video ();
+ Butler::Error e;
+ _player_video = _butler->get_video (&e);
+ if (!_player_video.first && e == Butler::AGAIN) {
+ signal_manager->when_idle (boost::bind(&FilmViewer::get, this));
+ return;
+ }
} while (
_player_video.first &&
_film->three_d() &&