invalid cast in m4a code

Bug #395978 reported by Iggy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
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)
Changed in mixxx:
milestone: none → 1.8.0
assignee: nobody → RJ Ryan (rryan)
Revision history for this message
happycodemonkey (happycodemonkey) wrote :

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

Revision history for this message
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)
Changed in mixxx:
status: New → Fix Committed
assignee: RJ Ryan (rryan) → C. Stewart (fenugrec)
Revision history for this message
Albert Santoni (gamegod) wrote :

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

Revision history for this message
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) ?

Revision history for this message
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);

Revision history for this message
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.

Revision history for this message
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) {

Revision history for this message
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)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5188

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.