+2013-10-16 Carl Hetherington <cth@carlh.net>
+
+ * Speed up response to some settings changes
+ (e.g. crop) (#196).
+
2013-10-15 Carl Hetherington <cth@carlh.net>
* Version 1.16 released.
void
Player::process_video (weak_ptr<Piece> weak_piece, shared_ptr<const Image> image, Eyes eyes, bool same, VideoContent::Frame frame)
{
+ /* Keep a note of what came in so that we can repeat it if required */
+ _last_process_video.weak_piece = weak_piece;
+ _last_process_video.image = image;
+ _last_process_video.eyes = eyes;
+ _last_process_video.same = same;
+ _last_process_video.frame = frame;
+
shared_ptr<Piece> piece = weak_piece.lock ();
if (!piece) {
return;
_out_subtitle.from = _in_subtitle.from + piece->content->position ();
_out_subtitle.to = _in_subtitle.to + piece->content->position ();
}
+
+/** Re-emit the last frame that was emitted, using current settings for crop, ratio, scaler and subtitles */
+void
+Player::repeat_last_video ()
+{
+ if (!_last_process_video.image) {
+ return;
+ }
+
+ process_video (
+ _last_process_video.weak_piece,
+ _last_process_video.image,
+ _last_process_video.eyes,
+ _last_process_video.same,
+ _last_process_video.frame
+ );
+}
void set_video_container_size (libdcp::Size);
+ void repeat_last_video ();
+
/** Emitted when a video frame is ready.
* First parameter is the video image.
* Second parameter is the eye(s) that should see this image.
bool _last_emit_was_black;
+ struct {
+ boost::weak_ptr<Piece> weak_piece;
+ boost::shared_ptr<const Image> image;
+ Eyes eyes;
+ bool same;
+ VideoContent::Frame frame;
+ } _last_process_video;
+
boost::signals2::scoped_connection _playlist_changed_connection;
boost::signals2::scoped_connection _playlist_content_changed_connection;
boost::signals2::scoped_connection _film_changed_connection;
_player->Changed.connect (boost::bind (&FilmViewer::player_changed, this, _1));
calculate_sizes ();
- fetch_current_frame_again ();
+ fetch_next_frame ();
}
void
return;
}
- /* Player::video_position is the time after the last frame that we received.
- We want to see it again, so seek back one frame.
+ /* We could do this with a seek and a fetch_next_frame, but this is
+ a shortcut to make it quicker.
*/
- Time p = _player->video_position() - _film->video_frames_to_time (1);
- if (p < 0) {
- p = 0;
- }
-
- _player->seek (p, true);
- fetch_next_frame ();
+ _got_frame = false;
+ _player->repeat_last_video ();
+ _panel->Refresh ();
+ _panel->Update ();
}
void