See lines 921 and 979 of src/utils/pacat.c.  The call to
pa_sndfile_format_from_string() at line 921 returns 20 when I use the
command syntax given by the bug reporter.  This value is later evaluated
against <= 0, which will trivially fail, thus file_format retains the
incorrect value of 20 instead of being assigned 65536 (which is
SF_FORMAT_WAV, 0x10000).  In turn, the call at line 991 to sf_open_fd()
will return NULL, because sf_open_fd() calls psf_open_file(), the latter
of which contains a conditional at line 2627 of SF_CONTAINER
(psf->sf.format), which returns 0 because psf->sf.format does not
contain a valid header because file_format was never correctly set to
0x10000, so psf_open_file() returns NULL, causing sf_open_fd() to return
NULL, causing pacat's main() to bail.

The culprit is simple to see: line 979 of pacat.c is incorrectly
checking against <= 0.  What is not immediately clear is whether the
value should be 20 instead of 0, because I have no way to verify the
stability or semantics of this value.  However, it is fairly easy to
verify that changing that one line resolves the reporter's symptom.

The larger issue at hand is that the above description is only
sufficient for WAV and WAVEX.  It does not address the other file
formats.  It seems that there is a rather significant portion of code
missing (bitrot?) from pacat.c to handle these conditions.

-- 
pacat --file-format option doesn't work
https://bugs.launchpad.net/bugs/660504
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to