Improve error reporting, in particular from dcpomatic_create.
[dcpomatic.git] / src / lib / sndfile_content.cc
index cfee7bd381b3fc6b615291f8ad590c064e6dc5dd..a93650b6d548e7888831b5d6da8acfe0c9d4f6fb 100644 (file)
@@ -34,17 +34,17 @@ using std::string;
 using std::cout;
 using boost::shared_ptr;
 
-SndfileContent::SndfileContent (shared_ptr<const Film> f, boost::filesystem::path p)
-       : Content (f, p)
-       , SingleStreamAudioContent (f, p)
+SndfileContent::SndfileContent (shared_ptr<const Film> film, boost::filesystem::path p)
+       : Content (film, p)
+       , SingleStreamAudioContent (film, p)
 {
 
 }
 
-SndfileContent::SndfileContent (shared_ptr<const Film> f, cxml::ConstNodePtr node, int version)
-       : Content (f, node)
-       , SingleStreamAudioContent (f, node, version)
-       , _audio_length (node->number_child<int64_t> ("AudioLength"))
+SndfileContent::SndfileContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
+       : Content (film, node)
+       , SingleStreamAudioContent (film, node, version)
+       , _audio_length (node->number_child<Frame> ("AudioLength"))
 {
 
 }
@@ -80,7 +80,7 @@ SndfileContent::valid_file (boost::filesystem::path f)
        /* XXX: more extensions */
        string ext = f.extension().string();
        transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
-       return (ext == ".wav" || ext == ".aif" || ext == ".aiff");
+       return (ext == ".wav" || ext == ".w64" || ext == ".flac" || ext == ".aif" || ext == ".aiff");
 }
 
 void
@@ -109,4 +109,3 @@ SndfileContent::full_length () const
        FrameRateChange const frc = film->active_frame_rate_change (position ());
        return DCPTime::from_frames (audio_length() / frc.speed_up, audio_stream()->frame_rate ());
 }
-