summaryrefslogtreecommitdiff
path: root/audio/musicpd/patches/patch-ab
blob: cfb8b65a58eac75a97d6b4dc8f2a3d1bb0734430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$NetBSD: patch-ab,v 1.5 2009/08/10 23:10:29 tnn Exp $

--- src/decoder/mp4ff_plugin.c.orig	2009-07-15 22:34:45.000000000 +0200
+++ src/decoder/mp4ff_plugin.c
@@ -47,7 +47,7 @@ mp4_get_aac_track(mp4ff_t * infile, faac
 	/* 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 @@ mp4_get_aac_track(mp4ff_t * infile, faac
 			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 */