Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audiofile 0.2.7 fails to build (on testsuite) #2

Closed
alessio opened this issue Aug 16, 2011 · 3 comments
Closed

audiofile 0.2.7 fails to build (on testsuite) #2

alessio opened this issue Aug 16, 2011 · 3 comments

Comments

@alessio
Copy link

alessio commented Aug 16, 2011

As you know, I'm working on the update of the Debian packaging of audiofile 0.2.7.

While I've been testbuilding the new package, I've encountered a build failure when running the testsuite:

testfloat: testing AIFF-C
testfloat: testing WAVE
testfloat: testing NeXT .snd
testfloat: testing IRCAM
testfloat passed
PASS: testfloat
testdouble: testing AIFF-C
testdouble: testing MS RIFF WAVE
testdouble: testing NeXT .snd/Sun .au
testdouble passed
PASS: testdouble
PASS: testmarkers
PASS: testchannelmatrix
PASS: seek
Testing AIFF
Testing AIFF-C
Testing NeXT .snd/Sun .au
Incorrect frame count in file opened for reading

FAIL: large

#1 of 25 tests failed

Here is the full buildlog:
http://paste.debian.net/126367/

Would you help me to fix that, please?

@mpruett
Copy link
Owner

mpruett commented Aug 16, 2011

Unmodified Audio File Library version 0.2.7 passes the test suite on x86_64. Since 10_au_length_unspecified.dpatch in Debian's audiofile 0.2.6-8 package doesn't apply cleanly against version 0.2.7, it appears that patch is the source of this failure.

The patch below against version 0.2.7 is based upon commit 085132b. With this change running the test suite is successful.

diff -ru audiofile-0.2.7/libaudiofile/next.c audiofile-0.2.7-patched/libaudiofile/next.c
--- audiofile-0.2.7/libaudiofile/next.c 2010-03-18 20:03:58.000000000 -0700
+++ audiofile-0.2.7-patched/libaudiofile/next.c 2011-08-16 11:48:12.163183373 -0700
@@ -64,6 +64,8 @@
    NULL            /* miscellaneous */
 };

+static const uint32_t _AU_LENGTH_UNSPECIFIED = 0xffffffff;
+
 status _af_next_read_init (AFfilesetup setup, AFfilehandle file)
 {
    uint32_t    id, offset, length, encoding, sampleRate, channelCount;
@@ -111,7 +113,11 @@
    track->f.compressionType = AF_COMPRESSION_NONE;

    track->fpos_first_frame = offset;
-   track->data_size = af_flength(file->fh) - offset;
+
+   off_t lengthAvailable = af_flength(file->fh) - offset;
+   if (length == _AU_LENGTH_UNSPECIFIED || length > lengthAvailable)
+       length = lengthAvailable;
+   track->data_size = length;

    switch (encoding)
    {

@alessio
Copy link
Author

alessio commented Aug 17, 2011

OK, so now the new 10_au_length_unspecified.patch looks so: http://paste.debian.net/126485/
What do you think about it?

@alessio alessio closed this as completed Aug 17, 2011
@alessio alessio reopened this Aug 17, 2011
@mpruett
Copy link
Owner

mpruett commented Aug 17, 2011

The previous version of 10_au_length_unspecified.dpatch is unnecessary, so what I posted above is the entirety of the patch:

http://paste.debian.net/126525/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants