ref: 765e42ebe975602c65f48dca7a6666ca3b4923af
parent: e40bfab7cdd66446cf538c17a6a7703abacb1da9
author: robs <robs>
date: Sun Sep 30 09:17:17 EDT 2007
Fix loss of 1 decoded FLAC block when using "trim 0 ..."
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
Bug fixes:
o Fix Sndtool read error causing noise at start. (Reynir Stefansson)
+ o Fix loss of 1 decoded FLAC block when using "trim 0 ...". (robs)
sox-14.0.0
--- a/src/sox.c
+++ b/src/sox.c
@@ -1369,7 +1369,7 @@
if (input_count == 1 && sox_neffects > 1 && strcmp(sox_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(&sox_effects[1][0]);
- if (sox_seek(files[0]->ft, offset, SOX_SEEK_SET) != SOX_EOF) {
+ if (offset && sox_seek(files[0]->ft, offset, SOX_SEEK_SET) != SOX_EOF) {
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