-void
-FilmViewer::film_changed (Film::Property p)
-{
- switch (p) {
- case Film::THUMBS:
- if (_film && _film->num_thumbs() > 1) {
- _slider->SetRange (0, _film->num_thumbs () - 1);
- } else {
- _thumb_panel->clear ();
- _slider->SetRange (0, 1);
- }
+ libdcp::Size old_size;
+ if (_display_frame) {
+ old_size = _display_frame->size();
+ }
+
+ boost::shared_ptr<Image> input = _raw_frame;
+
+ pair<string, string> const s = Filter::ffmpeg_strings (_film->filters());
+ if (!s.second.empty ()) {
+ input = input->post_process (s.second, true);
+ }
+
+ /* Get a compacted image as we have to feed it to wxWidgets */
+ _display_frame = input->scale_and_convert_to_rgb (_film_size, 0, _film->scaler(), false);
+
+ if (old_size != _display_frame->size()) {
+ _clear_required = true;
+ }
+
+ if (_raw_sub) {
+
+ /* Our output is already cropped by the decoder, so we need to account for that
+ when working out the scale that we are applying.
+ */
+
+ Size const cropped_size = _film->cropped_size (_film->size ());
+
+ Rect tx = subtitle_transformed_area (
+ float (_film_size.width) / cropped_size.width,
+ float (_film_size.height) / cropped_size.height,
+ _raw_sub->area(), _film->subtitle_offset(), _film->subtitle_scale()
+ );