#include "audio_buffers.h"
#include "dcpomatic_assert.h"
+#include "dcpomatic_log.h"
#include <cassert>
#include <cstring>
#include <cmath>
AudioBuffers::AudioBuffers (AudioBuffers const & other)
{
allocate (other._channels, other._frames);
+ LOG_GENERAL_NC("copy_from #5");
copy_from (&other, other._frames, 0, 0);
}
AudioBuffers::AudioBuffers (boost::shared_ptr<const AudioBuffers> other)
{
allocate (other->_channels, other->_frames);
+ LOG_GENERAL_NC("copy_from #6");
copy_from (other.get(), other->_frames, 0, 0);
}
deallocate ();
allocate (other._channels, other._frames);
+ LOG_GENERAL_NC("copy_from #7");
copy_from (&other, other._frames, 0, 0);
return *this;
return;
}
+ LOG_GENERAL("AudioBuffers::copy_from %1 %2 %3 %4", from->_allocated_frames, frames_to_copy, read_offset, write_offset);
+
DCPOMATIC_ASSERT (from->channels() == channels());
DCPOMATIC_ASSERT (from);
AudioBuffers::clone () const
{
shared_ptr<AudioBuffers> b (new AudioBuffers (channels (), frames ()));
+ LOG_GENERAL_NC("copy_from #3");
b->copy_from (this, frames (), 0, 0);
return b;
}
{
DCPOMATIC_ASSERT (channels() == other->channels());
ensure_size (_frames + other->frames());
+ LOG_GENERAL_NC("copy_from #4");
copy_from (other.get(), other->frames(), 0, _frames);
_frames += other->frames();
}
#include "audio_merger.h"
#include "dcpomatic_time.h"
+#include "dcpomatic_log.h"
#include <iostream>
using std::pair;
shared_ptr<AudioBuffers> audio (new AudioBuffers (i.audio->channels(), frames(DCPTime(time - i.time))));
/* Though time > i.time, audio->frames() could be 0 if the difference in time is less than one frame */
if (audio->frames() > 0) {
+ LOG_GENERAL("copy_from #1; pulling from %2", to_string(time));
audio->copy_from (i.audio.get(), audio->frames(), 0, 0);
out.push_back (make_pair (audio, i.time));
i.audio->trim_start (audio->frames ());
/* Get the part of audio that we want to use */
shared_ptr<AudioBuffers> part (new AudioBuffers (audio->channels(), frames(i.to) - frames(i.from)));
+ LOG_GENERAL_NC("copy_from #2");
part->copy_from (audio.get(), part->frames(), frames(DCPTime(i.from - time)), 0);
if (before == _buffers.end() && after == _buffers.end()) {
#include "image_decoder.h"
#include "compose.hpp"
#include "shuffler.h"
+#include "dcpomatic_log.h"
#include <dcp/reel.h>
#include <dcp/reel_sound_asset.h>
#include <dcp/reel_subtitle_asset.h>
return;
}
shared_ptr<AudioBuffers> cut (new AudioBuffers (content_audio.audio->channels(), remaining_frames));
+ LOG_GENERAL_NC("copy_from #8");
cut->copy_from (content_audio.audio.get(), remaining_frames, 0, 0);
content_audio.audio = cut;
}
return make_pair(shared_ptr<AudioBuffers>(), DCPTime());
}
shared_ptr<AudioBuffers> cut (new AudioBuffers (audio->channels(), remaining_frames));
+ LOG_GENERAL_NC("copy_from #9");
cut->copy_from (audio.get(), remaining_frames, discard_frames, 0);
return make_pair(cut, time + discard_time);
}
if (part_frames[0]) {
shared_ptr<AudioBuffers> part (new AudioBuffers (audio->channels(), part_frames[0]));
+ LOG_GENERAL_NC("copy from #10");
part->copy_from (audio.get(), part_frames[0], 0, 0);
_audio_reel->write (part);
}
if (part_frames[1]) {
shared_ptr<AudioBuffers> part (new AudioBuffers (audio->channels(), part_frames[1]));
+ LOG_GENERAL_NC("copy from #11");
part->copy_from (audio.get(), part_frames[1], part_frames[0], 0);
audio = part;
} else {