[linux-audio-dev] libsndfile: another strange issue

martin rumori lists at rumori.de
Tue May 18 23:35:22 UTC 2004

hi erik,

i've got another strange issue with libnsdfile (1.0.10beta6 and

it seems to be related to SFM_RDWR mode again.  if i open an existing
(but empty) file in RDWR mode, then switch to UPDATE_HEADER_AUTO mode,
then write to the file, then try to seek to the end of the file in
order to write again: then the seek command will fail or misbehave.

when seeking to file-end, SEEK SET, it will fail with "Internal
psf_fseek() failed.", if seeking to 0, SEEK_END, it will just seek to
zero regardless of the number of frames in the file.

all this proceeds if not switching to UPDATE_HEADER_AUTO.  though not
included in the test case, i got the same behavior when using
WRITE_HEADER_NOW after each write instead of UPDATE_HEADER_AUTO with
my "real-world" code.

this behavior seems to be independent from the sndfile format, but
just tested with WAV/16bit, AIFF/16bit, AIFF/float.

attached the "small test case", hope erik will like it again...



-------------- next part --------------
A non-text attachment was scrubbed...
Name: seek.c
Type: text/x-csrc
Size: 2866 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20040519/280e203f/attachment.c>

More information about the Linux-audio-dev mailing list