From ef6b25432d9c46d71b08c0f7d5f2686df428c4e8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 19 Nov 2006 16:45:16 +0000 Subject: Merged with trunk R1141 git-svn-id: svn://localhost/ardour2/branches/midi@1142 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audiosource.cc | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'libs/ardour/audiosource.cc') diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index 419fe9240c..93165b7fe4 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -368,26 +368,29 @@ AudioSource::initialize_peakfile (bool newfile, string audio_path) error << string_compose(_("AudioSource: cannot stat peakfile \"%1\""), peakpath) << endmsg; return -1; } - } else { - /* we found it in the peaks dir */ - } - - if (statbuf.st_size == 0) { _peaks_built = false; + } else { - // Check if the audio file has changed since the peakfile was built. - struct stat stat_file; - int err = stat (audio_path.c_str(), &stat_file); - if (!err && stat_file.st_mtime > statbuf.st_mtime){ + /* we found it in the peaks dir, so check it out */ + + if (statbuf.st_size == 0) { _peaks_built = false; } else { - _peaks_built = true; + // Check if the audio file has changed since the peakfile was built. + struct stat stat_file; + int err = stat (audio_path.c_str(), &stat_file); + + if (!err && stat_file.st_mtime > statbuf.st_mtime){ + _peaks_built = false; + } else { + _peaks_built = true; + } } } } - + if (!newfile && !_peaks_built && _build_missing_peakfiles && _build_peakfiles) { build_peaks_from_scratch (); } -- cgit v1.2.3