Bug#772874: libsndfile1-dev: bugs in some format handlers

2014-12-11 Thread Frank Heckenbach
Package: libsndfile1-dev
Version: 1.0.25-5
Severity: normal

- Ogg/Vorbis: vorbis_metatypes is lacking:

  { SF_STR_TRACKNUMBER, Tracknumber },
  { SF_STR_GENRE, Genre },

- Wav:

wav.c:308 has:

if (psf-filelength  SF_PLATFORM_S64 (0x))
psf_log_printf (psf, Warning : filelength  0x. This 
is bad\n) ;

But for non-seekable files, filelength is set to SF_COUNT_MAX which
is  0x, so this produces a bogus warning e.g. when doing:

cat somefile.wav | sndfile-info -

- Voc:

% sndfile-info test.voc

Version : libsndfile-1.0.25

Error : Not able to open input file test.voc.
File : test.voc
Length : 771512
Creative Voice File
dataoffset : 26
version: 0x0
checksum   : 0x10A
 Sound Data : 16380
  sr   : 156 = 1Hz
  comp : 0
Seems to be a multi-segment file (#1).
offset: 32size: 16380sum: 16412filelength: 771512

Error in VOC file, incompatible VOC sections.
%

The first error is clearly bogus because if it could not open the
file how could it (correctly) determine the length, samplerate etc.?
OK, that's just a problem with the formulation of the message
(open != parse).

But the second error is the real problem. It claims there is an
error in the file. However, this is an original file recorded with
original recorder software from Creative Labs on a Dos system some
20 years ago. (I just purged the samples because it was a private
recording and for compressibility ;), the error was the same before
and after.)

So I don't really think there's an error in the file. (It also plays
fine with other software such as mplayer.)

Looking at the code (voc.c:256) and also at the strace output, it
doesn't even check more than one section to determine whether
they're incompatible (whatever that means -- I guess sections with
different sample rates might qualify), just gives this message after
finding there's more than one section!?

I don't really understand what's up here. Either this is unfinished
code without the appropriate WIP warning, or the message is really
meant to say: Sorry, this library supports VOC files with one
section only, in which case the accusation Error in VOC file is
not a good way to put that. (Of course, fixing the actual code would
be preferable to fixing the error message. ;)


test.voc.xz
Description: Binary data


Bug#772874: libsndfile1-dev: bugs in some format handlers

2014-12-11 Thread Erik de Castro Lopo
Frank Heckenbach wrote:

 Package: libsndfile1-dev
 Version: 1.0.25-5
 Severity: normal

Thanks for the bug report.

None of these issues are Debian specific and hence are probably
better addressed in the upstream projects bug tracker:

https://github.com/erikd/libsndfile/

 - Ogg/Vorbis: vorbis_metatypes is lacking:
 
   { SF_STR_TRACKNUMBER, Tracknumber },
   { SF_STR_GENRE, Genre },

I raised this:

https://github.com/erikd/libsndfile/issues/87


 - Wav:
 
 wav.c:308 has:
 
 if (psf-filelength  SF_PLATFORM_S64 (0x))
 psf_log_printf (psf, Warning : filelength  0x. This 
 is bad\n) ;
 
 But for non-seekable files, filelength is set to SF_COUNT_MAX which
 is  0x, so this produces a bogus warning e.g. when doing:
 
 cat somefile.wav | sndfile-info -

https://github.com/erikd/libsndfile/issues/88


 - Voc:

snip

 The first error is clearly bogus because if it could not open the
 file how could it (correctly) determine the length, samplerate etc.?
 OK, that's just a problem with the formulation of the message
 (open != parse).

Open means that libsndfile's sf_open() function returns a non-NULL
pointer as documented here:

http://www.mega-nerd.com/libsndfile/api.html#open

 But the second error is the real problem. It claims there is an
 error in the file. However, this is an original file recorded with
 original recorder software from Creative Labs on a Dos system some
 20 years ago. (I just purged the samples because it was a private
 recording and for compressibility ;), the error was the same before
 and after.)

An error is returned when libsndfile cannot correctly open the file.
Is that not an error?

 Looking at the code (voc.c:256) and also at the strace output, it
 doesn't even check more than one section to determine whether
 they're incompatible (whatever that means -- I guess sections with
 different sample rates might qualify), just gives this message after
 finding there's more than one section!?

A couple of points here:

* VOC is a format that has not been in widespread use for over a decade.
* libsndfile does not handle *any* formats with more than one section.

 I don't really understand what's up here. Either this is unfinished
 code without the appropriate WIP warning,

Err, can you actually name one piece of non-trivial software that is
actually finished? All software is a WIP, and that is especially so
for most Open Source projects.

 or the message is really
 meant to say: Sorry, this library supports VOC files with one
 section only, in which case the accusation Error in VOC file is
 not a good way to put that.

If you look in the code you will find that Error in VOC file is
an error that can occur in a number of situations. Error reporting
is difficult.


Since none of these issues are Debian specific, I suggest you 
close this bug and follow the tickets on github.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org