using boost::optional;
using boost::function;
using namespace dcpomatic;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
/** Minimum video readahead in frames */
#define MINIMUM_VIDEO_READAHEAD 10
AudioMapping audio_mapping,
int audio_channels,
function<AVPixelFormat (AVPixelFormat)> pixel_format,
+ VideoRange video_range,
bool aligned,
bool fast
)
, _audio_channels (audio_channels)
, _disable_audio (false)
, _pixel_format (pixel_format)
+ , _video_range (video_range)
, _aligned (aligned)
, _fast (fast)
{
boost::mutex::scoped_lock lm (_mutex);
_finished = true;
_arrived.notify_all ();
+} catch (std::exception& e) {
+ store_current ();
+ boost::mutex::scoped_lock lm (_mutex);
+ _died = true;
+ _died_message = e.what ();
+ _arrived.notify_all ();
} catch (...) {
store_current ();
boost::mutex::scoped_lock lm (_mutex);
if (_suspended || (_video.empty() && !blocking)) {
if (e) {
- *e = AGAIN;
+ e->code = Error::AGAIN;
}
return make_pair(shared_ptr<PlayerVideo>(), DCPTime());
}
if (_video.empty()) {
if (e) {
if (_died) {
- *e = DIED;
+ e->code = Error::DIED;
+ e->message = _died_message;
} else if (_finished) {
- *e = FINISHED;
+ e->code = Error::FINISHED;
} else {
- *e = NONE;
+ e->code = Error::NONE;
}
}
return make_pair(shared_ptr<PlayerVideo>(), DCPTime());
/* If the weak_ptr cannot be locked the video obviously no longer requires any work */
if (video) {
LOG_TIMING("start-prepare in %1", thread_id());
- video->prepare (_pixel_format, _aligned, _fast);
+ video->prepare (_pixel_format, _video_range, _aligned, _fast);
LOG_TIMING("finish-prepare in %1", thread_id());
}
}
+catch (std::exception& e)
+{
+ store_current ();
+ boost::mutex::scoped_lock lm (_mutex);
+ _died = true;
+ _died_message = e.what ();
+}
catch (...)
{
store_current ();
_closed_caption.put (pt, *track, period);
}
+
+string
+Butler::Error::summary () const
+{
+ switch (code)
+ {
+ case Error::NONE:
+ return "No error registered";
+ case Error::AGAIN:
+ return "Butler not ready";
+ case Error::DIED:
+ return String::compose("Butler died (%1)", message);
+ case Error::FINISHED:
+ return "Butler finished";
+ }
+
+ return "";
+}
+