summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-12-24 16:27:55 +0000
committerCarl Hetherington <cth@carlh.net>2013-12-24 16:27:55 +0000
commitabc30110ea12e3e60f45f13556e8eda36a350458 (patch)
tree30c02f209f474da4b9f3495d51ddc60d4b2f7ee6 /src
parent64dc289b343641fc37db51fcd6b3069078cb5edf (diff)
Tidy up playback slightly.
Diffstat (limited to 'src')
-rw-r--r--src/lib/decoder.cc9
-rw-r--r--src/lib/player.cc22
2 files changed, 11 insertions, 20 deletions
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc
index 7f4973737..7102f2aa4 100644
--- a/src/lib/decoder.cc
+++ b/src/lib/decoder.cc
@@ -38,15 +38,6 @@ Decoder::Decoder (shared_ptr<const Film> f)
}
-class DecodedSorter
-{
-public:
- bool operator() (shared_ptr<Decoded> a, shared_ptr<Decoded> b)
- {
- return a->dcp_time < b->dcp_time;
- }
-};
-
shared_ptr<Decoded>
Decoder::peek ()
{
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 3e282136f..d08b7491d 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -144,11 +144,14 @@ Player::pass ()
if (dv && _video) {
DCPTime const half_frame = TIME_HZ / (2 * _film->video_frame_rate ());
+ bool consume = true;
+
if (_just_did_inaccurate_seek) {
+
/* Just emit; no subtlety */
emit_video (earliest_piece, dv);
- earliest_piece->decoder->consume ();
- } else if (earliest_time > (_video_position + half_frame)) {
+
+ } else if (abs (dv->dcp_time - _video_position) > half_frame) {
/* See if we're inside some video content */
list<shared_ptr<Piece> >::iterator i = _pieces.begin();
@@ -164,18 +167,15 @@ Player::pass ()
emit_video (_last_incoming_video.weak_piece, _last_incoming_video.video);
}
- } else {
+ consume = false;
- if (
- abs (dv->dcp_time - _video_position) < half_frame &&
- !earliest_piece->content->trimmed (dv->dcp_time - earliest_piece->content->position ())
- ) {
+ } else if (abs (dv->dcp_time - _video_position) < half_frame) {
+ emit_video (earliest_piece, dv);
+ }
- emit_video (earliest_piece, dv);
- }
-
+ if (consume) {
earliest_piece->decoder->consume ();
- }
+ }
} else if (da && _audio) {
if (!_just_did_inaccurate_seek && earliest_time > _audio_position) {