summaryrefslogtreecommitdiff
path: root/libs/libsndfile
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-06-20 18:50:38 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-06-20 18:50:38 +0000
commitbe362ae53c1d191e23d8a084d0327044bce4544c (patch)
treefb64f8276c64a495a0fdcf99e772d983af7725c0 /libs/libsndfile
parentc03dbd7568322d553ff681cb7f0bbd3452abd6cf (diff)
fixes for libsndfile conversion issues, tape track waveform display and overloaded virtual functions
git-svn-id: svn://localhost/ardour2/trunk@624 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/libsndfile')
-rw-r--r--libs/libsndfile/src/sndfile.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libs/libsndfile/src/sndfile.c b/libs/libsndfile/src/sndfile.c
index c30d7b61b4..b627c88ffe 100644
--- a/libs/libsndfile/src/sndfile.c
+++ b/libs/libsndfile/src/sndfile.c
@@ -1150,7 +1150,7 @@ sf_seek (SNDFILE *sndfile, sf_count_t offset, int whence)
** it makes sense.
*/
if (((whence & SFM_MASK) == SFM_WRITE && psf->mode == SFM_READ) ||
- ((whence & SFM_MASK) == SFM_WRITE && psf->mode == SFM_WRITE))
+ ((whence & SFM_MASK) == SFM_READ && psf->mode == SFM_WRITE))
{ psf->error = SFE_WRONG_SEEK ;
return PSF_SEEK_ERROR ;
} ;
@@ -1210,10 +1210,25 @@ sf_seek (SNDFILE *sndfile, sf_count_t offset, int whence)
if (psf->error)
return PSF_SEEK_ERROR ;
+#ifdef ECDL_ORIGINAL#
if (seek_from_start < 0 || seek_from_start > psf->sf.frames)
{ psf->error = SFE_BAD_SEEK ;
return PSF_SEEK_ERROR ;
} ;
+#else
+ if (((whence & SFM_MASK) == SFM_WRITE) || (psf->mode == SFM_WRITE || psf->mode == SFM_RDWR))
+ { if (seek_from_start < 0 /* || (seek_from_start > psf->sf.frames && post-audio chunks exist) */ )
+ { psf->error = SFE_BAD_SEEK ;
+ return PSF_SEEK_ERROR ;
+ }
+ }
+ else /* seek for reading */
+ { if (seek_from_start < 0 || seek_from_start > psf->sf.frames)
+ { psf->error = SFE_BAD_SEEK ;
+ return PSF_SEEK_ERROR ;
+ }
+ }
+#endif
if (psf->seek)
{ int new_mode = (whence & SFM_MASK) ? (whence & SFM_MASK) : psf->mode ;
@@ -1234,6 +1249,7 @@ sf_seek (SNDFILE *sndfile, sf_count_t offset, int whence)
break ;
} ;
+
psf->last_op = new_mode ;
return retval ;