changeset 754:26636c46bcdf

If a reader doesn't provide a file sample rate, blow up -- don't just assume
author Chris Cannam
date Thu, 07 Mar 2013 17:17:58 +0000
parents fb6313da1df6
children dc6c0e50724c
files data/fileio/CodedAudioFileReader.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/fileio/CodedAudioFileReader.cpp	Tue Dec 11 13:07:40 2012 +0000
+++ b/data/fileio/CodedAudioFileReader.cpp	Thu Mar 07 17:17:58 2013 +0000
@@ -96,8 +96,8 @@
     SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: file rate = " << m_fileRate << endl;
 
     if (m_fileRate == 0) {
-        SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: ERROR: File sample rate unknown (bug in subclass implementation?)" << endl;
-        m_fileRate = 48000; // got to have something
+        std::cerr << "CodedAudioFileReader::initialiseDecodeCache: ERROR: File sample rate unknown (bug in subclass implementation?)" << std::endl;
+        throw FileOperationFailed("(coded file)", "File sample rate unknown (bug in subclass implementation?)");
     }
     if (m_sampleRate == 0) {
         m_sampleRate = m_fileRate;