diff --git a/pd/src/d_soundfile.c b/pd/src/d_soundfile.c index 0cf6de4c2790cea428400341ad9d2892b2115781..6c7148842e17c058dfa5db99a0e1d1ad8c215528 100644 --- a/pd/src/d_soundfile.c +++ b/pd/src/d_soundfile.c @@ -113,7 +113,7 @@ typedef struct _wavechunk /* ... and the last two items */ #define WAV_INT 1 #define WAV_FLOAT 3 -/* the AIFF header. I'm assuming AIFC is compatible but don't really know +/* the cd lib header. I'm assuming AIFC is compatible but don't really know that. */ typedef struct _datachunk @@ -292,7 +292,8 @@ int open_soundfile_via_fd(int fd, int headersize, { long chunksize = swap4(((t_wavechunk *)buf)->wc_size, swap), seekto = headersize + chunksize + 8, seekout; - + if (seekto & 1) /* pad up to even number of bytes */ + seekto++; if (!strncmp(((t_wavechunk *)buf)->wc_id, "fmt ", 4)) { long commblockonset = headersize + 8; @@ -344,6 +345,8 @@ int open_soundfile_via_fd(int fd, int headersize, { long chunksize = swap4(((t_datachunk *)buf)->dc_size, swap), seekto = headersize + chunksize + 8, seekout; + if (seekto & 1) /* pad up to even number of bytes */ + seekto++; /* post("chunk %c %c %c %c seek %d", ((t_datachunk *)buf)->dc_id[0], ((t_datachunk *)buf)->dc_id[1],