X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsndfile_content.cc;h=363c11b094dae6f0b7de869f32984229d21ad383;hb=387304bc9147933b68eda2b38ba8cac0d250e87e;hp=a573d43c407f8ac8a825190a1784600ba37ac873;hpb=9e4c091e6ef0f79fab10664e95240de2f14e5702;p=dcpomatic.git diff --git a/src/lib/sndfile_content.cc b/src/lib/sndfile_content.cc index a573d43c4..363c11b09 100644 --- a/src/lib/sndfile_content.cc +++ b/src/lib/sndfile_content.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2014 Carl Hetherington + Copyright (C) 2013-2015 Carl Hetherington 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 @@ -18,21 +18,19 @@ */ #include -#include #include "sndfile_content.h" #include "sndfile_decoder.h" #include "film.h" #include "compose.hpp" #include "job.h" #include "util.h" +#include "safe_stringstream.h" #include "i18n.h" using std::string; -using std::stringstream; using std::cout; using boost::shared_ptr; -using dcp::raw_convert; SndfileContent::SndfileContent (shared_ptr f, boost::filesystem::path p) : Content (f, p) @@ -72,25 +70,6 @@ SndfileContent::technical_summary () const + " - sndfile"; } -string -SndfileContent::information () const -{ - if (_audio_frame_rate == 0) { - return ""; - } - - stringstream s; - - s << String::compose ( - _("%1 channels, %2kHz, %3 samples"), - audio_channels(), - audio_frame_rate() / 1000.0, - audio_length().frames (audio_frame_rate ()) - ); - - return s.str (); -} - bool SndfileContent::valid_file (boost::filesystem::path f) { @@ -113,7 +92,8 @@ DCPTime SndfileContent::full_length () const { shared_ptr film = _film.lock (); - assert (film); - return DCPTime (audio_length(), film->active_frame_rate_change (position ())); + DCPOMATIC_ASSERT (film); + FrameRateChange const frc = film->active_frame_rate_change (position ()); + return DCPTime::from_frames (audio_length() / frc.speed_up, film->audio_frame_rate ()); }