X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsndfile_content.cc;h=f9eb62a2bb790a6e1e2c5841db82f751e8a36814;hb=11e5bedb083e94611f7b12f2d8a55e97739c5710;hp=cfee7bd381b3fc6b615291f8ad590c064e6dc5dd;hpb=0a93237cb5e4642d3b698ff9b7d0cfae5401478c;p=dcpomatic.git diff --git a/src/lib/sndfile_content.cc b/src/lib/sndfile_content.cc index cfee7bd38..f9eb62a2b 100644 --- a/src/lib/sndfile_content.cc +++ b/src/lib/sndfile_content.cc @@ -27,6 +27,8 @@ #include "safe_stringstream.h" #include "raw_convert.h" #include +#include +#include #include "i18n.h" @@ -34,17 +36,17 @@ using std::string; using std::cout; using boost::shared_ptr; -SndfileContent::SndfileContent (shared_ptr f, boost::filesystem::path p) - : Content (f, p) - , SingleStreamAudioContent (f, p) +SndfileContent::SndfileContent (shared_ptr film, boost::filesystem::path p) + : Content (film, p) + , SingleStreamAudioContent (film, p) { } -SndfileContent::SndfileContent (shared_ptr f, cxml::ConstNodePtr node, int version) - : Content (f, node) - , SingleStreamAudioContent (f, node, version) - , _audio_length (node->number_child ("AudioLength")) +SndfileContent::SndfileContent (shared_ptr film, cxml::ConstNodePtr node, int version) + : Content (film, node) + , SingleStreamAudioContent (film, node, version) + , _audio_length (node->number_child ("AudioLength")) { } @@ -80,7 +82,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 @@ -104,9 +106,6 @@ SndfileContent::take_from_audio_examiner (shared_ptr examiner) DCPTime SndfileContent::full_length () const { - shared_ptr film = _film.lock (); - DCPOMATIC_ASSERT (film); - FrameRateChange const frc = film->active_frame_rate_change (position ()); + FrameRateChange const frc (audio_video_frame_rate(), film()->video_frame_rate()); return DCPTime::from_frames (audio_length() / frc.speed_up, audio_stream()->frame_rate ()); } -