diff data/fileio/MP3FileReader.cpp @ 1307:c84629395040 mp3-gapless

Handle trimming the padding from end as well
author Chris Cannam
date Tue, 29 Nov 2016 13:34:51 +0000
parents b325e91505b5
children aa1b1fc2d018
line wrap: on
line diff
--- a/data/fileio/MP3FileReader.cpp	Tue Nov 29 12:06:49 2016 +0000
+++ b/data/fileio/MP3FileReader.cpp	Tue Nov 29 13:34:51 2016 +0000
@@ -72,7 +72,7 @@
     m_reporter = reporter;
 
     if (m_gaplessMode == Gapless) {
-        CodedAudioFileReader::setSamplesToTrim(DEFAULT_DECODER_DELAY, 0);
+        CodedAudioFileReader::setFramesToTrim(DEFAULT_DECODER_DELAY, 0);
     }
     
     struct stat stat;
@@ -375,7 +375,7 @@
     return data->reader->filter(stream, frame);
 }
 
-static string toMagic(uint32_t fourcc)
+static string toMagic(unsigned long fourcc)
 {
     string magic("....");
     for (int i = 0; i < 4; ++i) {
@@ -437,8 +437,8 @@
                 (void)mad_bit_read(&ptr, 8);
             }
 
-            uint32_t delay = mad_bit_read(&ptr, 12);
-            uint32_t padding = mad_bit_read(&ptr, 12);
+            auto delay = mad_bit_read(&ptr, 12);
+            auto padding = mad_bit_read(&ptr, 12);
 
             sv_frame_t delayToDrop = DEFAULT_DECODER_DELAY + delay;
             sv_frame_t paddingToDrop = padding - DEFAULT_DECODER_DELAY;
@@ -451,7 +451,7 @@
                     << " samples from start and " << paddingToDrop
                     << " from end" << endl;
 
-            CodedAudioFileReader::setSamplesToTrim(delayToDrop, paddingToDrop);
+            CodedAudioFileReader::setFramesToTrim(delayToDrop, paddingToDrop);
             
         } else {
             SVDEBUG << "MP3FileReader: Xing frame has no LAME metadata" << endl;