shithub: sox

Download patch

ref: b5a13b5234c36fe40fae0db86b58d43ef94499e3
parent: 69d3c4df5460ab7daa0e3f371d433ed9fb51a634
author: robs <robs>
date: Tue Oct 23 15:59:38 EDT 2007

Fix trim when first effect with IMA-ADPCM input wav file

--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,10 @@
   o Added support for non-standard, non-WAVE_FORMAT_EXTENSIBLE
     (esp. 24-bit) PCM wav.  (robs)
 
+  Effects:
+
+  o Reimplemented reverb using freeverb.  (robs)
+
   Bug fixes:
 
   o Fix Sndtool read error causing noise at start.  (Reynir Stefánsson)
@@ -21,10 +25,7 @@
   o Fix ogg vorbis compile error on some platforms.
   o Remove unused libltdl that could cause header mismatch with
     installed libltdl.
-
-  Effects:
-
-  o Reimplemented reverb using freeverb.  (robs)
+  o Fix trim when first effect with IMA-ADPCM input wav file.  (robs)
 
 
 sox-14.0.0
--- a/src/sox.c
+++ b/src/sox.c
@@ -1371,7 +1371,7 @@
   if (input_count == 1 && ofile_effects_chain.length > 1 && strcmp(ofile_effects_chain.effects[1][0].handler.name, "trim") == 0) {
     if ((files[0]->ft->handler->flags & SOX_FILE_SEEK) && files[0]->ft->seekable){
       sox_size_t offset = sox_trim_get_start(&ofile_effects_chain.effects[1][0]);
-      if (offset && sox_seek(files[0]->ft, offset, SOX_SEEK_SET) != SOX_EOF) { 
+      if (offset && sox_seek(files[0]->ft, offset, SOX_SEEK_SET) == SOX_SUCCESS) { 
         read_wide_samples = offset / files[0]->ft->signal.channels;
         /* Assuming a failed seek stayed where it was.  If the 
          * seek worked then reset the start location of