summaryrefslogtreecommitdiff
path: root/src/lib/player.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-02-13 15:32:16 +0000
committerCarl Hetherington <cth@carlh.net>2017-04-19 23:04:32 +0100
commitb800a9051f068b4b11a08248601bc7099e79807f (patch)
tree7287c651f1f0041806a025193273ab8dcf8bbe75 /src/lib/player.cc
parent26807fe95fb7fbf0e5e6a8e32ab35068712ef058 (diff)
Fix bug in gap-filling; rename _last_video_time -> _last_time.
Diffstat (limited to 'src/lib/player.cc')
-rw-r--r--src/lib/player.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index d9fb8dfae..611e9c900 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -521,7 +521,6 @@ Player::pass ()
return true;
}
- cout << "Pass " << earliest->content->path(0) << "\n";
earliest->decoder->pass ();
/* Emit any audio that is ready */
@@ -587,8 +586,10 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
/* Fill gaps */
- if (_last_video_time) {
- for (DCPTime i = _last_video_time.get(); i < time; i += DCPTime::from_frames (1, _film->video_frame_rate())) {
+ if (_last_time) {
+ /* XXX: this may not work for 3D */
+ DCPTime const frame = DCPTime::from_frames (1, _film->video_frame_rate());
+ for (DCPTime i = _last_time.get() + frame; i < time; i += frame) {
if (_playlist->video_content_at(i) && _last_video) {
Video (shared_ptr<PlayerVideo> (new PlayerVideo (*_last_video)), i);
} else {
@@ -616,10 +617,9 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
_last_video->set_subtitle (subtitles.get ());
}
- _last_video_time = time;
+ _last_time = time;
- cout << "Video @ " << to_string(_last_video_time.get()) << "\n";
- Video (_last_video, *_last_video_time);
+ Video (_last_video, *_last_time);
/* Discard any subtitles we no longer need */
@@ -772,8 +772,8 @@ Player::seek (DCPTime time, bool accurate)
}
if (accurate) {
- _last_video_time = time - DCPTime::from_frames (1, _film->video_frame_rate ());
+ _last_time = time - DCPTime::from_frames (1, _film->video_frame_rate ());
} else {
- _last_video_time = optional<DCPTime> ();
+ _last_time = optional<DCPTime> ();
}
}