pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/41872: audio/musicpd fails to play mp4 files with faad2-2.7 on sparc64



>Number:         41872
>Category:       pkg
>Synopsis:       audio/musicpd fails to play mp4 files with faad2-2.7 on sparc64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 10 22:55:00 +0000 2009
>Originator:     RM
>Release:        
>Organization:
>Environment:
NetBSD ultra10 5.0_STABLE NetBSD 5.0_STABLE (GENERIC) #0: Thu Jul 30 12:57:34 
BST 2009  root@ultra10:/opt/obj.sparc64/sys/arch/sparc64/compile/GENERIC sparc64
>Description:
When loading mp4 file, musicpd logs the following error:

mp4ff: Invalid audio format: 0:16:2

The above line shows that the first format parameter, which is sample rate, is 
set to 0. This is wrong.

This is a 64-bit bug, unit32_t vs unsigned long datatypes. The patch below 
fixes the issue for me.
>How-To-Repeat:

>Fix:
--- src/decoder/mp4ff_plugin.c.orig     2009-07-15 21:34:45.000000000 +0100
+++ src/decoder/mp4ff_plugin.c  2009-08-10 23:45:39.000000000 +0100
@@ -47,7 +47,7 @@
        /* neaacdec.h declares all arguments as "unsigned long", but
           internally expects uint32_t pointers.  To avoid gcc
           warnings, use this workaround. */
-       unsigned long *sample_rate_r = (unsigned long*)sample_rate;
+       unsigned long sample_rate_r;
 #else
        uint32_t *sample_rate_r = sample_rate;
 #endif
@@ -73,12 +73,14 @@
                        continue;
 
                rc = faacDecInit2(decoder, buff, buff_size,
-                                 sample_rate_r, channels_r);
+                                 &sample_rate_r, channels_r);
                free(buff);
 
-               if (rc >= 0)
+               if (rc >= 0) {
                        /* found a valid AAC track */
+                       *sample_rate = (uint32_t)sample_rate_r;
                        return i;
+               }
        }
 
        /* can't decode this */



Home | Main Index | Thread Index | Old Index