Use make_shared<>.
[dcpomatic.git] / test / silence_padding_test.cc
index 53c5021c39fb4ddf6e9fb7a61e63f67fe3b95eb7..5ece7d9cd180ec45e22d1b16f2c2c9af5d4a00ae 100644 (file)
  *  @brief Test the padding (with silence) of a mono source to a 6-channel DCP.
  */
 
-#include <boost/test/unit_test.hpp>
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
+#include "lib/dcp_content_type.h"
+#include "lib/ratio.h"
+#include "test.h"
 #include <dcp/cpl.h>
 #include <dcp/dcp.h>
 #include <dcp/sound_asset.h>
 #include <dcp/sound_frame.h>
 #include <dcp/reel.h>
 #include <dcp/reel_sound_asset.h>
-#include "lib/ffmpeg_content.h"
-#include "lib/film.h"
-#include "lib/dcp_content_type.h"
-#include "lib/ratio.h"
-#include "test.h"
+#include <dcp/sound_asset_reader.h>
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
 
 using std::string;
 using boost::lexical_cast;
 using boost::shared_ptr;
+using boost::make_shared;
 
 static void
 test_silence_padding (int channels)
@@ -48,7 +51,7 @@ test_silence_padding (int channels)
        film->set_container (Ratio::from_id ("185"));
        film->set_name (film_name);
 
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/staircase.wav"));
+       shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/staircase.wav");
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
@@ -72,7 +75,7 @@ test_silence_padding (int channels)
        int frame = 0;
 
        while (n < sound_asset->asset()->intrinsic_duration()) {
-               shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->asset()->get_frame (frame++);
+               shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->asset()->start_read()->get_frame (frame++);
                uint8_t const * d = sound_frame->data ();
 
                for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->asset()->channels())) {