Remove Sndfile code and use FFmpeg instead.
authorCarl Hetherington <cth@carlh.net>
Mon, 16 May 2016 22:46:51 +0000 (23:46 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 18 May 2016 10:50:29 +0000 (11:50 +0100)
21 files changed:
src/lib/content_factory.cc
src/lib/ffmpeg_audio_stream.h
src/lib/player.cc
src/lib/playlist.cc
src/lib/sndfile_base.cc [deleted file]
src/lib/sndfile_base.h [deleted file]
src/lib/sndfile_content.h [deleted file]
src/lib/sndfile_decoder.cc [deleted file]
src/lib/sndfile_decoder.h [deleted file]
src/lib/sndfile_examiner.cc [deleted file]
src/lib/sndfile_examiner.h [deleted file]
src/lib/wscript
test/audio_analysis_test.cc
test/audio_delay_test.cc
test/audio_processor_test.cc
test/ffmpeg_audio_test.cc
test/isdcf_name_test.cc
test/silence_padding_test.cc
test/upmixer_a_test.cc
test/wscript
wscript

index c3278e30e1bf02f626f9f77dd6e408f9956acc69..e21a4c0d0760f721247b94066f14f3ee609458ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
  */
 
 #include "ffmpeg_content.h"
+#include "audio_content.h"
 #include "image_content.h"
-#include "sndfile_content.h"
 #include "text_subtitle_content.h"
 #include "dcp_content.h"
 #include "dcp_subtitle_content.h"
 #include "util.h"
+#include "ffmpeg_audio_stream.h"
 #include "film.h"
 #include "log_entry.h"
 #include "log.h"
@@ -57,11 +58,29 @@ content_factory (shared_ptr<const Film> film, cxml::NodePtr node, int version, l
        boost::shared_ptr<Content> content;
 
        if (type == "FFmpeg") {
+               /* SndfileContent is now handled by the FFmpeg code rather than by
+                  separate libsndfile-based code.
+               */
                content.reset (new FFmpegContent (film, node, version, notes));
        } else if (type == "Image") {
                content.reset (new ImageContent (film, node, version));
        } else if (type == "Sndfile") {
-               content.reset (new SndfileContent (film, node, version));
+               /* SndfileContent is now handled by the FFmpeg code rather than by
+                  separate libsndfile-based code.
+               */
+               content.reset (new FFmpegContent (film, node, version, notes));
+
+               content->audio->set_stream (
+                       AudioStreamPtr (
+                               new FFmpegAudioStream (
+                                       "Stream", 0,
+                                       node->number_child<int> ("AudioFrameRate"),
+                                       node->number_child<Frame> ("AudioLength"),
+                                       AudioMapping (node->node_child ("AudioMapping"), version)
+                                       )
+                               )
+                       );
+
        } else if (type == "SubRip" || type == "TextSubtitle") {
                content.reset (new TextSubtitleContent (film, node, version));
        } else if (type == "DCP") {
@@ -137,8 +156,6 @@ content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
 
                if (valid_image_file (path)) {
                        content.reset (new ImageContent (film, path));
-               } else if (SndfileContent::valid_file (path)) {
-                       content.reset (new SndfileContent (film, path));
                } else if (ext == ".srt" || ext == ".ssa") {
                        content.reset (new TextSubtitleContent (film, path));
                } else if (ext == ".xml") {
index 8de43c6323727b3ced2208c34248719dd6c6f428..984d8ccadba95a45f75b82c2702282e1e96fb5dc 100644 (file)
@@ -31,6 +31,11 @@ public:
                , AudioStream (frame_rate, length, channels)
        {}
 
+       FFmpegAudioStream (std::string name, int id, int frame_rate, Frame length, AudioMapping mapping)
+               : FFmpegStream (name, id)
+               , AudioStream (frame_rate, length, mapping)
+       {}
+
        FFmpegAudioStream (cxml::ConstNodePtr, int);
 
        void as_xml (xmlpp::Node *) const;
index 801e145af09745096582d88b01159a8a0fca9804..cd841d1ce565fc36cb833ec3ad06952a0d89c5e4 100644 (file)
 #include "film.h"
 #include "ffmpeg_decoder.h"
 #include "video_decoder.h"
+#include "audio_decoder.h"
 #include "audio_buffers.h"
 #include "audio_content.h"
 #include "ffmpeg_content.h"
 #include "image_decoder.h"
+#include "content_audio.h"
 #include "image_content.h"
-#include "sndfile_decoder.h"
-#include "sndfile_content.h"
 #include "subtitle_content.h"
 #include "text_subtitle_decoder.h"
 #include "text_subtitle_content.h"
@@ -160,34 +160,6 @@ Player::setup_pieces ()
                        frc = FrameRateChange (ic->active_video_frame_rate(), _film->video_frame_rate());
                }
 
-               /* SndfileContent */
-               shared_ptr<const SndfileContent> sc = dynamic_pointer_cast<const SndfileContent> (i);
-               if (sc) {
-                       decoder.reset (new SndfileDecoder (sc, _fast, _film->log()));
-
-                       /* Work out a FrameRateChange for the best overlap video for this content */
-                       DCPTime best_overlap_t;
-                       shared_ptr<Content> best_overlap;
-                       BOOST_FOREACH (shared_ptr<Content> j, _playlist->content ()) {
-                               if (!j->video) {
-                                       continue;
-                               }
-
-                               DCPTime const overlap = min (j->end(), i->end()) - max (j->position(), i->position());
-                               if (overlap > best_overlap_t) {
-                                       best_overlap = j;
-                                       best_overlap_t = overlap;
-                               }
-                       }
-
-                       if (best_overlap) {
-                               frc = FrameRateChange (best_overlap->active_video_frame_rate(), _film->video_frame_rate ());
-                       } else {
-                               /* No video overlap; e.g. if the DCP is just audio */
-                               frc = FrameRateChange (_film->video_frame_rate(), _film->video_frame_rate ());
-                       }
-               }
-
                /* It's questionable whether subtitle content should have a video frame rate; perhaps
                   it should be assumed that any subtitle content has been prepared at the same rate
                   as simultaneous video content (like we do with audio).
index bd6abc31d0a98455bf9bfe996eec876015743d96..41ce862b53837fa945ce6cab5cb0f6eb31230246 100644 (file)
@@ -18,8 +18,6 @@
 */
 
 #include "playlist.h"
-#include "sndfile_content.h"
-#include "sndfile_decoder.h"
 #include "video_content.h"
 #include "subtitle_content.h"
 #include "ffmpeg_decoder.h"
diff --git a/src/lib/sndfile_base.cc b/src/lib/sndfile_base.cc
deleted file mode 100644 (file)
index 712df7b..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifdef DCPOMATIC_WINDOWS
-#include <windows.h>
-#define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1
-#endif
-#include <sndfile.h>
-
-#include "sndfile_base.h"
-#include "sndfile_content.h"
-#include "exceptions.h"
-
-#include "i18n.h"
-
-using boost::shared_ptr;
-
-Sndfile::Sndfile (shared_ptr<const SndfileContent> c)
-       : _sndfile_content (c)
-{
-       _info.format = 0;
-
-       /* Here be monsters.  See fopen_boost for similar shenanigans */
-#ifdef DCPOMATIC_WINDOWS
-       _sndfile = sf_wchar_open (_sndfile_content->path(0).c_str(), SFM_READ, &_info);
-#else
-       _sndfile = sf_open (_sndfile_content->path(0).string().c_str(), SFM_READ, &_info);
-#endif
-
-       if (!_sndfile) {
-               throw DecodeError (_("could not open audio file for reading"));
-       }
-}
-
-Sndfile::~Sndfile ()
-{
-       sf_close (_sndfile);
-}
diff --git a/src/lib/sndfile_base.h b/src/lib/sndfile_base.h
deleted file mode 100644 (file)
index 4b7a50f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef DCPOMATIC_SNDFILE_BASE_H
-#define DCPOMATIC_SNDFILE_BASE_H
-
-#include <sndfile.h>
-#include <boost/shared_ptr.hpp>
-
-class SndfileContent;
-
-class Sndfile
-{
-public:
-       Sndfile (boost::shared_ptr<const SndfileContent> content);
-       virtual ~Sndfile ();
-
-protected:
-       boost::shared_ptr<const SndfileContent> _sndfile_content;
-       SNDFILE* _sndfile;
-       SF_INFO _info;
-};
-
-#endif
diff --git a/src/lib/sndfile_content.h b/src/lib/sndfile_content.h
deleted file mode 100644 (file)
index cdb842c..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef DCPOMATIC_SNDFILE_CONTENT_H
-#define DCPOMATIC_SNDFILE_CONTENT_H
-
-#include "content.h"
-
-class AudioExaminer;
-
-class SndfileContent : public Content
-{
-public:
-       SndfileContent (boost::shared_ptr<const Film>, boost::filesystem::path);
-       SndfileContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
-
-       boost::shared_ptr<SndfileContent> shared_from_this () {
-               return boost::dynamic_pointer_cast<SndfileContent> (Content::shared_from_this ());
-       }
-
-       DCPTime full_length () const;
-
-       void examine (boost::shared_ptr<Job>);
-       std::string summary () const;
-       std::string technical_summary () const;
-       std::string information () const;
-       void as_xml (xmlpp::Node *) const;
-
-       static bool valid_file (boost::filesystem::path);
-};
-
-#endif
diff --git a/src/lib/sndfile_decoder.cc b/src/lib/sndfile_decoder.cc
deleted file mode 100644 (file)
index 2a2b3fe..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <iostream>
-#include <sndfile.h>
-#include "audio_content.h"
-#include "sndfile_content.h"
-#include "sndfile_decoder.h"
-#include "exceptions.h"
-#include "audio_buffers.h"
-
-#include "i18n.h"
-
-using std::vector;
-using std::string;
-using std::min;
-using std::cout;
-using boost::shared_ptr;
-
-SndfileDecoder::SndfileDecoder (shared_ptr<const SndfileContent> c, bool fast, shared_ptr<Log> log)
-       : Sndfile (c)
-       , _done (0)
-       , _remaining (_info.frames)
-       , _deinterleave_buffer (0)
-{
-       audio.reset (new AudioDecoder (this, c->audio, fast, log));
-}
-
-SndfileDecoder::~SndfileDecoder ()
-{
-       delete[] _deinterleave_buffer;
-}
-
-bool
-SndfileDecoder::pass (PassReason, bool)
-{
-       if (_remaining == 0) {
-               return true;
-       }
-
-       /* Do things in half second blocks as I think there may be limits
-          to what FFmpeg (and in particular the resampler) can cope with.
-       */
-       sf_count_t const block = _sndfile_content->audio->stream()->frame_rate() / 2;
-       sf_count_t const this_time = min (block, _remaining);
-
-       int const channels = _sndfile_content->audio->stream()->channels ();
-
-       shared_ptr<AudioBuffers> data (new AudioBuffers (channels, this_time));
-
-       if (_sndfile_content->audio->stream()->channels() == 1) {
-               /* No de-interleaving required */
-               sf_read_float (_sndfile, data->data(0), this_time);
-       } else {
-               /* Deinterleave */
-               if (!_deinterleave_buffer) {
-                       _deinterleave_buffer = new float[block * channels];
-               }
-               sf_readf_float (_sndfile, _deinterleave_buffer, this_time);
-               vector<float*> out_ptr (channels);
-               for (int i = 0; i < channels; ++i) {
-                       out_ptr[i] = data->data(i);
-               }
-               float* in_ptr = _deinterleave_buffer;
-               for (int i = 0; i < this_time; ++i) {
-                       for (int j = 0; j < channels; ++j) {
-                               *out_ptr[j]++ = *in_ptr++;
-                       }
-               }
-       }
-
-       data->set_frames (this_time);
-       audio->give (_sndfile_content->audio->stream (), data, ContentTime::from_frames (_done, _info.samplerate));
-       _done += this_time;
-       _remaining -= this_time;
-
-       return _remaining == 0;
-}
-
-void
-SndfileDecoder::seek (ContentTime t, bool accurate)
-{
-       audio->seek (t, accurate);
-
-       _done = t.frames_round (_info.samplerate);
-       _remaining = _info.frames - _done;
-}
diff --git a/src/lib/sndfile_decoder.h b/src/lib/sndfile_decoder.h
deleted file mode 100644 (file)
index d3f9342..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "audio_decoder.h"
-#include "sndfile_base.h"
-
-class SndfileContent;
-
-class SndfileDecoder : public Sndfile, public Decoder
-{
-public:
-       SndfileDecoder (boost::shared_ptr<const SndfileContent> c, bool fast, boost::shared_ptr<Log> log);
-       ~SndfileDecoder ();
-
-private:
-       bool pass (PassReason, bool);
-       void seek (ContentTime, bool);
-
-       int64_t _done;
-       int64_t _remaining;
-       float* _deinterleave_buffer;
-};
diff --git a/src/lib/sndfile_examiner.cc b/src/lib/sndfile_examiner.cc
deleted file mode 100644 (file)
index 5f2338a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "sndfile_examiner.h"
-
-using boost::shared_ptr;
-
-SndfileExaminer::SndfileExaminer (shared_ptr<const SndfileContent> content)
-       : Sndfile (content)
-{
-
-}
-
-int
-SndfileExaminer::audio_channels () const
-{
-       return _info.channels;
-}
-
-Frame
-SndfileExaminer::audio_length () const
-{
-       return _info.frames;
-}
-
-int
-SndfileExaminer::audio_frame_rate () const
-{
-       return _info.samplerate;
-}
diff --git a/src/lib/sndfile_examiner.h b/src/lib/sndfile_examiner.h
deleted file mode 100644 (file)
index c64ceae..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "sndfile_base.h"
-#include "audio_examiner.h"
-
-class SndfileExaminer : public Sndfile, public AudioExaminer
-{
-public:
-       SndfileExaminer (boost::shared_ptr<const SndfileContent> content);
-
-       int audio_channels () const;
-       Frame audio_length () const;
-       int audio_frame_rate () const;
-};
index 4b6754b2e9d7432f9a8d12985f632379d755f260..fe4eac114019c85a9998bfca48914ca0807e8df0 100644 (file)
@@ -114,10 +114,6 @@ sources = """
           send_kdm_email_job.cc
           send_problem_report_job.cc
           server.cc
-          sndfile_base.cc
-          sndfile_content.cc
-          sndfile_decoder.cc
-          sndfile_examiner.cc
           string_log_entry.cc
           text_subtitle.cc
           text_subtitle_content.cc
@@ -153,7 +149,7 @@ def build(bld):
     obj.uselib = """
                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE
                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 BOOST_REGEX
-                 SNDFILE SAMPLERATE POSTPROC TIFF MAGICK SSH DCP CXML GLIB LZMA XML++
+                 SAMPLERATE POSTPROC TIFF MAGICK SSH DCP CXML GLIB LZMA XML++
                  CURL ZIP FONTCONFIG PANGOMM CAIROMM XMLSEC SUB ICU
                  """
 
index 4069471db4018736f5d8ecbabcd7c1934def9d60..ee40baf58130a82a8007e7175745eeb3d35add62 100644 (file)
@@ -25,7 +25,7 @@
 #include "lib/audio_analysis.h"
 #include "lib/analyse_audio_job.h"
 #include "lib/film.h"
-#include "lib/sndfile_content.h"
+#include "lib/ffmpeg_content.h"
 #include "lib/dcp_content_type.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/ratio.h"
@@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test)
        film->set_name ("audio_analysis_test");
        boost::filesystem::path p = private_data / "betty_L.wav";
 
-       shared_ptr<SndfileContent> c (new SndfileContent (film, p));
+       shared_ptr<FFmpegContent> c (new FFmpegContent (film, p));
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
@@ -157,7 +157,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test3)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
 
-       shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/white.wav"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/white.wav"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
index f1b804830a4bb78660afbc4a92f1e93be8a11be8..a538da4ed655f58c46821bf8fef924e6b4bf4095 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 /** @file  test/audio_delay_test.cc
- *  @brief Test encode using some SndfileContents which have audio delays.
+ *  @brief Test encode using some FFmpegContents which have audio delays.
  *
  *  The output is checked algorithmically using knowledge of the input.
  */
@@ -29,7 +29,7 @@
 #include <dcp/reel.h>
 #include <dcp/sound_asset.h>
 #include <dcp/reel_sound_asset.h>
-#include "lib/sndfile_content.h"
+#include "lib/ffmpeg_content.h"
 #include "lib/dcp_content_type.h"
 #include "lib/ratio.h"
 #include "lib/film.h"
@@ -53,7 +53,7 @@ void test_audio_delay (int delay_in_ms)
        film->set_container (Ratio::from_id ("185"));
        film->set_name (film_name);
 
-       shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/staircase.wav"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/staircase.wav"));
        content->audio->set_delay (delay_in_ms);
        film->examine_and_add_content (content);
        wait_for_jobs ();
index a668a7e0953d6059f1c8b76c7a6a9fc0fd804272..652c3dc5fdbd071374c121cfee57e3b4ce9b9e6f 100644 (file)
@@ -21,7 +21,7 @@
 #include "lib/analyse_audio_job.h"
 #include "lib/dcp_content_type.h"
 #include "lib/job_manager.h"
-#include "lib/sndfile_content.h"
+#include "lib/ffmpeg_content.h"
 #include "lib/film.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
@@ -33,7 +33,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_test)
 {
        shared_ptr<Film> film = new_test_film ("audio_processor_test");
        film->set_name ("audio_processor_test");
-       shared_ptr<SndfileContent> c (new SndfileContent (film, "test/data/white.wav"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/white.wav"));
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
index 4d6200d78d5bab9ed1c6fb63f18fce0f219920a2..5fe5ea7c7023b110f701bf603ff1cea4597efdbe 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
 #include <dcp/sound_frame.h>
 #include <dcp/reel_sound_asset.h>
 #include <dcp/reel.h>
-#include "lib/sndfile_content.h"
+#include "lib/ffmpeg_content.h"
 #include "lib/film.h"
 #include "lib/dcp_content_type.h"
 #include "lib/video_content.h"
index bdd9c03136849e15966b2b4222ad845acb90dc5b..3341cc862e436929ea9c3f2f461ad6113d30b885 100644 (file)
@@ -22,9 +22,9 @@
 #include "lib/ratio.h"
 #include "lib/dcp_content_type.h"
 #include "lib/image_content.h"
-#include "lib/sndfile_content.h"
 #include "lib/video_content.h"
 #include "lib/audio_mapping.h"
+#include "lib/ffmpeg_content.h"
 #include "lib/audio_content.h"
 #include "test.h"
 #include <iostream>
@@ -127,7 +127,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
        /* Test audio channel markup */
 
        film->set_audio_channels (6);
-       shared_ptr<SndfileContent> sound (new SndfileContent (film, "test/data/sine_440.wav"));
+       shared_ptr<FFmpegContent> sound (new FFmpegContent (film, "test/data/sine_440.wav"));
        film->examine_and_add_content (sound);
        wait_for_jobs ();
        BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_10_4K_DI_20140704_PP_SMPTE_OV");
index 30f7e106e3494acd385790e8b681f3f13deca43b..b068528126fd0ea85d5daa5b414bc62a693fba75 100644 (file)
@@ -28,7 +28,7 @@
 #include <dcp/sound_frame.h>
 #include <dcp/reel.h>
 #include <dcp/reel_sound_asset.h>
-#include "lib/sndfile_content.h"
+#include "lib/ffmpeg_content.h"
 #include "lib/film.h"
 #include "lib/dcp_content_type.h"
 #include "lib/ratio.h"
@@ -47,7 +47,7 @@ test_silence_padding (int channels)
        film->set_container (Ratio::from_id ("185"));
        film->set_name (film_name);
 
-       shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/staircase.wav"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/staircase.wav"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
index 5b7cff7d2fc3eeb1e2b057d497837bcae9fe8858..904fe797ae74832784d56302d8cb7a1875e6448a 100644 (file)
@@ -22,7 +22,7 @@
 #include "lib/film.h"
 #include "lib/ratio.h"
 #include "lib/dcp_content_type.h"
-#include "lib/sndfile_content.h"
+#include "lib/ffmpeg_content.h"
 #include "lib/player.h"
 #include "lib/audio_buffers.h"
 #include "lib/upmixer_a.h"
@@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE (upmixer_a_test)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_audio_processor (AudioProcessor::from_id ("stereo-5.1-upmix-a"));
-       shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/white.wav"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/white.wav"));
        film->examine_and_add_content (content);
 
        wait_for_jobs ();
index a93eac6611afe37aa0b4458315a87938d0922da1..1ddc25d702d333c9ef32d132336bcb3475461f51 100644 (file)
@@ -21,11 +21,13 @@ def configure(conf):
     if conf.env.TARGET_WINDOWS:
         boost_test_suffix='-mt'
 
-    conf.check_cxx(fragment = """
-                              #define BOOST_TEST_MODULE Config test\n
-                             #include <boost/test/unit_test.hpp>\n
-                              int main() {}
-                              """, msg = 'Checking for boost unit testing library', lib = 'boost_unit_test_framework%s' % boost_test_suffix, uselib_store = 'BOOST_TEST')
+    conf.check_cfg(package='sndfile', args='--cflags --libs', uselib_store='SNDFILE', mandatory=True)
+
+    conf.check_cxx(fragment="""
+                            #define BOOST_TEST_MODULE Config test\n
+                           #include <boost/test/unit_test.hpp>\n
+                            int main() {}
+                            """, msg = 'Checking for boost unit testing library', lib = 'boost_unit_test_framework%s' % boost_test_suffix, uselib_store = 'BOOST_TEST')
 
 def build(bld):
     obj = bld(features='cxx cxxprogram')
diff --git a/wscript b/wscript
index 1bcc66c4667394aede0d6c5d31b26c5c285c1558..95ead6e5097aeeb20e33d3c6caf3a19cf4d390e7 100644 (file)
--- a/wscript
+++ b/wscript
@@ -176,9 +176,6 @@ def configure(conf):
                        lib=['icuio', 'icui18n', 'icudata', 'icuuc'],
                        uselib_store='ICU')
 
-    # libsndfile
-    conf.check_cfg(package='sndfile', args='--cflags --libs', uselib_store='SNDFILE', mandatory=True)
-
     # libsamplerate
     conf.check_cfg(package='samplerate', args='--cflags --libs', uselib_store='SAMPLERATE', mandatory=True)