diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-08-02 15:52:11 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-08-14 21:07:48 +0100 |
| commit | d66bcea066deb3b3cd919a69aab7e2078fb52ca8 (patch) | |
| tree | cb2282b43244129f467a26576603845ad8abe3e0 /src | |
| parent | 69829c8c664d301de3f123f9893210eea89d8026 (diff) | |
Remove Film dependency from Butler.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/butler.cc | 8 | ||||
| -rw-r--r-- | src/lib/butler.h | 6 | ||||
| -rw-r--r-- | src/lib/ffmpeg_encoder.cc | 2 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/butler.cc b/src/lib/butler.cc index 910b5ea48..ef565c02b 100644 --- a/src/lib/butler.cc +++ b/src/lib/butler.cc @@ -43,11 +43,11 @@ using boost::optional; /** Minimum audio readahead in frames; should never be reached unless there are bugs in Player */ #define MAXIMUM_AUDIO_READAHEAD (48000*60) -#define LOG_WARNING(...) _film.lock()->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_WARNING); +#define LOG_WARNING(...) _log->log (String::compose(__VA_ARGS__), LogEntry::TYPE_WARNING); -Butler::Butler (weak_ptr<const Film> film, shared_ptr<Player> player, AudioMapping audio_mapping, int audio_channels) - : _film (film) - , _player (player) +Butler::Butler (shared_ptr<Player> player, shared_ptr<Log> log, AudioMapping audio_mapping, int audio_channels) + : _player (player) + , _log (log) , _prepare_work (new boost::asio::io_service::work (_prepare_service)) , _pending_seek_accurate (false) , _finished (false) diff --git a/src/lib/butler.h b/src/lib/butler.h index 1e8947f9d..e416ba818 100644 --- a/src/lib/butler.h +++ b/src/lib/butler.h @@ -29,14 +29,14 @@ #include <boost/signals2.hpp> #include <boost/asio.hpp> -class Film; class Player; class PlayerVideo; +class Log; 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); + Butler (boost::shared_ptr<Player> player, boost::shared_ptr<Log> log, AudioMapping map, int audio_channels); ~Butler (); void seek (DCPTime position, bool accurate); @@ -53,8 +53,8 @@ private: bool should_run () const; void prepare (boost::weak_ptr<PlayerVideo> video) const; - boost::weak_ptr<const Film> _film; boost::shared_ptr<Player> _player; + boost::shared_ptr<Log> _log; boost::thread* _thread; VideoRingBuffers _video; diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc index 2a9146f11..c96f1b5e5 100644 --- a/src/lib/ffmpeg_encoder.cc +++ b/src/lib/ffmpeg_encoder.cc @@ -99,7 +99,7 @@ FFmpegEncoder::FFmpegEncoder (shared_ptr<const Film> film, weak_ptr<Job> job, bo } } - _butler.reset (new Butler (film, _player, map, _output_audio_channels)); + _butler.reset (new Butler (_player, film->log(), map, _output_audio_channels)); } void diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 4c3cc386c..0299b2462 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -239,7 +239,7 @@ FilmViewer::recreate_butler () map.set (2, 1, 1 / sqrt(2)); // C -> R } - _butler.reset (new Butler (_film, _player, map, _audio_channels)); + _butler.reset (new Butler (_player, _film->log(), map, _audio_channels)); if (!Config::instance()->preview_sound()) { _butler->disable_audio (); } |
