diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-01-06 16:45:18 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-01-06 16:45:18 +0000 |
| commit | 34b40f12d7eec52862999da9e4417fc8f6e0f9af (patch) | |
| tree | ea24126bc477d8fddceb6c1e001d4cadb302dd06 /src/lib/player.cc | |
| parent | 9314d6bdf8857bc6cd29b0596158f2d0ff787513 (diff) | |
Basics of per-channel audio gain.
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index cacb42651..e1bf1fdb5 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -344,10 +344,18 @@ Player::process_audio (weak_ptr<Piece> weak_piece, shared_ptr<const AudioBuffers /* Remap channels */ shared_ptr<AudioBuffers> dcp_mapped (new AudioBuffers (_film->audio_channels(), audio->frames())); dcp_mapped->make_silent (); - list<pair<int, libdcp::Channel> > map = content->audio_mapping().content_to_dcp (); - for (list<pair<int, libdcp::Channel> >::iterator i = map.begin(); i != map.end(); ++i) { - if (i->first < audio->channels() && i->second < dcp_mapped->channels()) { - dcp_mapped->accumulate_channel (audio.get(), i->first, i->second); + + AudioMapping map = content->audio_mapping (); + for (int i = 0; i < map.content_channels(); ++i) { + for (int j = 0; j < _film->audio_channels(); ++j) { + if (map.get (i, static_cast<libdcp::Channel> (j)) > 0) { + dcp_mapped->accumulate_channel ( + audio.get(), + i, + static_cast<libdcp::Channel> (j), + map.get (i, static_cast<libdcp::Channel> (j)) + ); + } } } |
