Remove out-of-date comment.
[dcpomatic.git] / src / lib / ffmpeg_encoder.cc
index 8f36bbda1a7b58ea3a9e738ade3caad0d11a0f64..6b31c4201901bf5004b7a1efc9a848615799c5fd 100644 (file)
@@ -48,7 +48,6 @@ using namespace boost::placeholders;
 #endif
 
 
-/** @param key Key to use to encrypt MP4 outputs */
 FFmpegEncoder::FFmpegEncoder (
        shared_ptr<const Film> film,
        weak_ptr<Job> job,
@@ -108,7 +107,16 @@ FFmpegEncoder::FFmpegEncoder (
        }
 
        _butler = std::make_shared<Butler>(
-               _film, _player, map, _output_audio_channels, bind(&PlayerVideo::force, FFmpegFileEncoder::pixel_format(format)), VideoRange::VIDEO, Image::Alignment::PADDED, false, false
+               _film,
+               _player,
+               map,
+               _output_audio_channels,
+               bind(&PlayerVideo::force, FFmpegFileEncoder::pixel_format(format)),
+               VideoRange::VIDEO,
+               Image::Alignment::PADDED,
+               false,
+               false,
+               Butler::Audio::ENABLED
                );
 }
 
@@ -161,7 +169,7 @@ FFmpegEncoder::go ()
 
        auto const video_frame = DCPTime::from_frames (1, _film->video_frame_rate ());
        int const audio_frames = video_frame.frames_round(_film->audio_frame_rate());
-       float* interleaved = new float[_output_audio_channels * audio_frames];
+       std::vector<float> interleaved(_output_audio_channels * audio_frames);
        auto deinterleaved = make_shared<AudioBuffers>(_output_audio_channels, audio_frames);
        int const gets_per_frame = _film->three_d() ? 2 : 1;
        for (DCPTime i; i < _film->length(); i += video_frame) {
@@ -204,9 +212,9 @@ FFmpegEncoder::go ()
 
                waker.nudge ();
 
-               _butler->get_audio (Butler::Behaviour::BLOCKING, interleaved, audio_frames);
+               _butler->get_audio (Butler::Behaviour::BLOCKING, interleaved.data(), audio_frames);
                /* XXX: inefficient; butler interleaves and we deinterleave again */
-               float* p = interleaved;
+               float* p = interleaved.data();
                for (int j = 0; j < audio_frames; ++j) {
                        for (int k = 0; k < _output_audio_channels; ++k) {
                                deinterleaved->data(k)[j] = *p++;
@@ -214,7 +222,6 @@ FFmpegEncoder::go ()
                }
                encoder->audio (deinterleaved);
        }
-       delete[] interleaved;
 
        for (auto i: file_encoders) {
                i.flush ();