Ogg/Vorbis files can consist of multiple parts, simply concatenated
together:
% head -c 10000 /dev/zero | oggenc -r - -o foo.ogg
% head -c 10000 /dev/zero | oggenc -r - -o bar.ogg
% cat foo.ogg bar.ogg > baz.ogg
But libsndfile doesn't handle those files correctly. While it shows
the correct size:
% sndfile-info baz.ogg
[...]
Frames : 5000
Channels : 2
It only reads the frames of the first part (the bug is in the
library, not in sndfile-convert; I get the same result with my own
programs using the library):
% sndfile-convert -pcm16 baz.ogg baz.wav
% sndfile-info baz.wav
[...]
Frames : 2500
Channels : 2
To fix it, when using libvorbisfile, one would just check the result
of ov_read_* for OV_HOLE and retry, but libsndfile doesn't use
libvorbisfile, but a lower-level interface ...