diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-06-16 15:52:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-06-16 15:52:32 +0100 |
| commit | 6e52f83418c64d5cbd0e613a5fc96ea32881d4d9 (patch) | |
| tree | 722da0c3f985bb0e0d38077ca4992e4580546356 /src/lib/video_decoder.cc | |
| parent | 739a52b20895622a1caf48d3597ae49e6ec0aeeb (diff) | |
Fix subtitle controls in the viewer.
Diffstat (limited to 'src/lib/video_decoder.cc')
| -rw-r--r-- | src/lib/video_decoder.cc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 58aceb407..54d14e2c6 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -61,20 +61,22 @@ VideoDecoder::video (shared_ptr<Image> image, bool same, Time t) shared_ptr<Image> out = image->scale_and_convert_to_rgb (image_size, film->scaler(), true); - shared_ptr<Subtitle> sub; - if (_timed_subtitle && _timed_subtitle->displayed_at (t)) { - sub = _timed_subtitle->subtitle (); - } - - if (sub) { - dcpomatic::Rect const tx = subtitle_transformed_area ( - float (image_size.width) / video_size().width, - float (image_size.height) / video_size().height, - sub->area(), film->subtitle_offset(), film->subtitle_scale() - ); - - shared_ptr<Image> im = sub->image()->scale (tx.size(), film->scaler(), true); - out->alpha_blend (im, tx.position()); + if (film->with_subtitles ()) { + shared_ptr<Subtitle> sub; + if (_timed_subtitle && _timed_subtitle->displayed_at (t)) { + sub = _timed_subtitle->subtitle (); + } + + if (sub) { + dcpomatic::Rect const tx = subtitle_transformed_area ( + float (image_size.width) / video_size().width, + float (image_size.height) / video_size().height, + sub->area(), film->subtitle_offset(), film->subtitle_scale() + ); + + shared_ptr<Image> im = sub->image()->scale (tx.size(), film->scaler(), true); + out->alpha_blend (im, tx.position()); + } } if (image_size != container_size) { |
