summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-02-22 14:09:50 +0000
committerCarl Hetherington <cth@carlh.net>2017-04-19 23:04:32 +0100
commitc20b1952c9a3187b91ce49423fa8093fcf9661bc (patch)
treefa0777ea1ed590206840a414d37c5b005e7ab9b8 /src/lib
parentb20c4b11abff0bd57dab03174070ec8571bbe4d5 (diff)
More fixes to when to pull from the audio merger.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/player.cc17
-rw-r--r--src/lib/transcoder.cc1
2 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index eeeef2cb3..0011f7ab2 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -146,6 +146,14 @@ Player::setup_pieces ()
}
}
+ BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
+ if (i->content->audio) {
+ BOOST_FOREACH (AudioStreamPtr j, i->content->audio->streams()) {
+ _stream_states[j] = StreamState (i, i->content->position ());
+ }
+ }
+ }
+
_have_valid_pieces = true;
}
@@ -555,6 +563,7 @@ Player::pass ()
}
}
+// cout << "PULL " << to_string(pull_from) << "\n";
pair<shared_ptr<AudioBuffers>, DCPTime> audio = _audio_merger.pull (pull_from);
if (audio.first->frames() > 0) {
DCPOMATIC_ASSERT (audio.second >= _last_audio_time);
@@ -740,13 +749,11 @@ Player::audio (weak_ptr<Piece> wp, AudioStreamPtr stream, ContentAudio content_a
content_audio.audio = _audio_processor->run (content_audio.audio, _film->audio_channels ());
}
+// cout << "PUSH " << content_audio.audio->frames() << " @ " << to_string(time) << "\n";
_audio_merger.push (content_audio.audio, time);
- if (_stream_states.find (stream) == _stream_states.end ()) {
- _stream_states[stream] = StreamState (piece, time);
- } else {
- _stream_states[stream].last_push_end = time + DCPTime::from_frames (content_audio.audio->frames(), _film->audio_frame_rate());
- }
+ DCPOMATIC_ASSERT (_stream_states.find (stream) != _stream_states.end ());
+ _stream_states[stream].last_push_end = time + DCPTime::from_frames (content_audio.audio->frames(), _film->audio_frame_rate());
}
void
diff --git a/src/lib/transcoder.cc b/src/lib/transcoder.cc
index e2bbca98e..de2fb1d33 100644
--- a/src/lib/transcoder.cc
+++ b/src/lib/transcoder.cc
@@ -115,7 +115,6 @@ Transcoder::video (shared_ptr<PlayerVideo> data, DCPTime time)
void
Transcoder::audio (shared_ptr<AudioBuffers> data, DCPTime time)
{
- cout << "tx receives " << data->frames() << " @ " << to_string(time) << "\n";
_writer->write (data);
shared_ptr<Job> job = _job.lock ();