invalid cast in m4a code

Bug #395978 reported by Iggy on 2009-07-06
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Undecided
fenugrec

Bug Description

When building mixxx-1.7-beta1 on OSX I hit an issue in the m4a code. I don't have the exact error handy right now. The error was on line 153 of src/m4a/mp4-mixxx.cpp. I removed the uint32_t * cast on that line, and it built fine.

System Details:
OSX 10.5
i386
libmp4v2-1.5.0.1
libFAAD2-2.7

Let me know if you need any more information.

RJ Skerry-Ryan (rryan) on 2009-10-13
Changed in mixxx:
milestone: none → 1.8.0
assignee: nobody → RJ Ryan (rryan)

I got this same error in Arch Linux building the lastest trunk code, same fix worked for me as well.

fenugrec (fenugrec) wrote :

For reference, I'm attaching a patch for this fix.
The whole m4a implementation should be cleaned up & packed
into a single file (soundsourcem4a.cpp) like the other proxies...
I might get around to doing that eventually.

Albert Santoni (gamegod) on 2010-01-09
Changed in mixxx:
status: New → Fix Committed
assignee: RJ Ryan (rryan) → C. Stewart (fenugrec)
Albert Santoni (gamegod) wrote :

My original LP email reply got lost for this, but anyways, thanks for finding the fix guys!

RJ Skerry-Ryan (rryan) wrote :

Trunk won't build for me now with the patch. I think the problem here is that Arch and Ubuntu package different versions of the FAAD library. The declaration on the Ubuntu version is:

int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, unsigned char *pBuffer,
                               uint32_t SizeOfDecoderSpecificInfo,
                               uint32_t *samplerate, uint8_t *channels);

The samplerate parameter is in fact a uint32_t* type, so the uint32_t* cast is appropriate.

Can someone with Arch linux please post the prototype of NeAACDecInit2 or faacDecInit2 in your equivalent of /usr/include/faad.h (maybe /usr/include/neaacdec.h) ?

fenugrec (fenugrec) wrote :

Interesting. On arch with latest faad2 (2.7) my /u/i/faad.h
actually includes /u/i/neaacdec.h .

char NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder,
                               unsigned char *pBuffer,
                               unsigned long SizeOfDecoderSpecificInfo,
                               unsigned long *samplerate,
                               unsigned char *channels);

RJ Skerry-Ryan (rryan) wrote :

Looks like the prototype changed between version 2.6 and 2.7. I added a line to the SConscript which performs a CheckLibWithHeader for libfaad and explicitly tries to compile the line:

faacDecInit2(0, 0, 0, (unsigned long*)0, (unsigned char*)0);

If the compilation fails, then we know that 2.6 is installed, so I define an M4AHACK symbol that we can #ifdef in mp4-mixxx.cpp.

fenugrec (fenugrec) wrote :

Sorry, doesn't work here (faad 2.7) :
------------
[...]
Apple M4A audio file support... enabled

scons: ***
File "/home/patator/mixxxdev/mixxx/mixxx/src/SConscript", line 1019, in <module>
$>
------------

Also: mp4-mixxx.cpp line 189 (if __M4AHACK__ is not defined)
    (unsigned int*)&priv->sample_rate, &priv->channels) < 0) {
would need to be changed to
    (unsigned long*)&priv->sample_rate, &priv->channels) < 0) {

fenugrec (fenugrec) wrote :

#2257 fixes the SConscript (nice job Sean) , but in my case (faad 2.7)
I also needed to patch mp4-mixxx.cpp

RJ Skerry-Ryan (rryan) on 2010-10-05
Changed in mixxx:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments