summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-11-30 23:49:04 +0100
committerCarl Hetherington <cth@carlh.net>2020-12-01 00:20:51 +0100
commit5b6b01ea778064a0b0125ea8ebd9272a534cccd2 (patch)
treeb9fcb7a7336240e700686c256b6aa29d8b7f7fa7 /src
parentd1a57244622f5f4160d0f58af7fe71a829175345 (diff)
Give Butler a weak_ptr<Film>
Diffstat (limited to 'src')
-rw-r--r--src/lib/butler.cc6
-rw-r--r--src/lib/butler.h2
-rw-r--r--src/lib/ffmpeg_encoder.cc2
-rw-r--r--src/wx/film_viewer.cc1
4 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/butler.cc b/src/lib/butler.cc
index d27778b70..4ab0092c4 100644
--- a/src/lib/butler.cc
+++ b/src/lib/butler.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2016-2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2016-2020 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -58,6 +58,7 @@ using namespace boost::placeholders;
* @param fast Same as above for the `fast' flag.
*/
Butler::Butler (
+ weak_ptr<const Film> film,
shared_ptr<Player> player,
AudioMapping audio_mapping,
int audio_channels,
@@ -66,7 +67,8 @@ Butler::Butler (
bool aligned,
bool fast
)
- : _player (player)
+ : _film (film)
+ , _player (player)
, _prepare_work (new boost::asio::io_service::work (_prepare_service))
, _pending_seek_accurate (false)
, _suspended (0)
diff --git a/src/lib/butler.h b/src/lib/butler.h
index 6b933be4b..1fe05742f 100644
--- a/src/lib/butler.h
+++ b/src/lib/butler.h
@@ -37,6 +37,7 @@ class Butler : public ExceptionStore, public boost::noncopyable
{
public:
Butler (
+ boost::weak_ptr<const Film> film,
boost::shared_ptr<Player> player,
AudioMapping map,
int audio_channels,
@@ -87,6 +88,7 @@ private:
void player_change (ChangeType type);
void seek_unlocked (dcpomatic::DCPTime position, bool accurate);
+ boost::weak_ptr<const Film> _film;
boost::shared_ptr<Player> _player;
boost::thread _thread;
diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc
index 1d8feffa8..443e16939 100644
--- a/src/lib/ffmpeg_encoder.cc
+++ b/src/lib/ffmpeg_encoder.cc
@@ -107,7 +107,7 @@ FFmpegEncoder::FFmpegEncoder (
}
_butler.reset (
- new Butler(_player, map, _output_audio_channels, bind(&PlayerVideo::force, _1, FFmpegFileEncoder::pixel_format(format)), VIDEO_RANGE_VIDEO, true, false)
+ new Butler(_film, _player, map, _output_audio_channels, bind(&PlayerVideo::force, _1, FFmpegFileEncoder::pixel_format(format)), VIDEO_RANGE_VIDEO, true, false)
);
}
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index e91cdc9a0..bca3631ab 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -212,6 +212,7 @@ FilmViewer::recreate_butler ()
_butler.reset(
new Butler(
+ _film,
_player,
Config::instance()->audio_mapping(_audio_channels),
_audio_channels,