Untested use of Frame for video/audio content lengths.
[dcpomatic.git] / src / lib / audio_content.cc
index c0e99b24cb5902ad9dbdd8d142c429f1fb7f6a7b..def123fb11489870cb5090a698350a0c2bf3c241 100644 (file)
@@ -25,8 +25,8 @@
 #include "config.h"
 #include "frame_rate_change.h"
 #include "audio_processor.h"
+#include "raw_convert.h"
 #include <libcxml/cxml.h>
-#include <dcp/raw_convert.h>
 
 #include "i18n.h"
 
@@ -38,7 +38,6 @@ using std::fixed;
 using std::setprecision;
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
-using dcp::raw_convert;
 
 int const AudioContentProperty::AUDIO_CHANNELS = 200;
 int const AudioContentProperty::AUDIO_LENGTH = 201;
@@ -90,7 +89,7 @@ AudioContent::AudioContent (shared_ptr<const Film> f, vector<shared_ptr<Content>
        : Content (f, c)
 {
        shared_ptr<AudioContent> ref = dynamic_pointer_cast<AudioContent> (c[0]);
-       assert (ref);
+       DCPOMATIC_ASSERT (ref);
        
        for (size_t i = 0; i < c.size(); ++i) {
                shared_ptr<AudioContent> ac = dynamic_pointer_cast<AudioContent> (c[i]);
@@ -163,7 +162,7 @@ boost::signals2::connection
 AudioContent::analyse_audio (boost::function<void()> finished)
 {
        shared_ptr<const Film> film = _film.lock ();
-       assert (film);
+       DCPOMATIC_ASSERT (film);
        
        shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, dynamic_pointer_cast<AudioContent> (shared_from_this())));
        boost::signals2::connection c = job->Finished.connect (finished);
@@ -181,7 +180,7 @@ AudioContent::audio_analysis_path () const
        }
 
        boost::filesystem::path p = film->audio_analysis_dir ();
-       p /= digest().get_value_or ("X") + "_" + audio_mapping().digest();
+       p /= digest() + "_" + audio_mapping().digest();
        return p;
 }
 
@@ -189,9 +188,9 @@ string
 AudioContent::technical_summary () const
 {
        return String::compose (
-               "audio: channels %1, length %2, content rate %3, resampled rate %4",
+               "audio: channels %1, length %2 frames, content rate %3, resampled rate %4",
                audio_channels(),
-               audio_length().seconds(),
+               audio_length(),
                audio_frame_rate(),
                resampled_audio_frame_rate()
                );
@@ -210,7 +209,7 @@ int
 AudioContent::resampled_audio_frame_rate () const
 {
        shared_ptr<const Film> film = _film.lock ();
-       assert (film);
+       DCPOMATIC_ASSERT (film);
        
        /* Resample to a DCI-approved sample rate */
        double t = dcp_audio_frame_rate (audio_frame_rate ());