summaryrefslogtreecommitdiff
path: root/devel/pwlib/patches/patch-ay
blob: 60942acd7a8a277bc8daf1fba1945e849f78737a (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
$NetBSD: patch-ay,v 1.1 2007/03/14 17:12:47 yyamano Exp $

--- src/ptlib/unix/maccoreaudio.cxx.orig	2004-11-18 17:40:47.000000000 +0900
+++ src/ptlib/unix/maccoreaudio.cxx
@@ -1323,8 +1323,8 @@ OSStatus PSoundChannelCoreAudio::SetupAd
 	bufferSizeBytes += bufferSizeBytes / 10; // +10%
 
    //calculate size of ABL given the last field, assum non-interleaved 
-   UInt32 propsize = 
-      offsetof(AudioBufferList, mBuffers[hwASBD.mChannelsPerFrame]);
+   UInt32 mChannelsPerFrame = hwASBD.mChannelsPerFrame;
+   UInt32 propsize = (UInt32) &(((AudioBufferList *)0)->mBuffers[mChannelsPerFrame]);
 
    //malloc buffer lists
    mInputBufferList = (AudioBufferList *)malloc(propsize);
@@ -1358,7 +1358,8 @@ OSStatus PSoundChannelCoreAudio::SetupAd
 
 
    //calculate number of buffers from channels
-   propsize = offsetof(AudioBufferList, mBuffers[pwlibASBD.mChannelsPerFrame]);
+   mChannelsPerFrame = pwlibASBD.mChannelsPerFrame;
+   propsize = (UInt32) &(((AudioBufferList *)0)->mBuffers[mChannelsPerFrame]);
 
    //malloc buffer lists
    mOutputBufferList = (AudioBufferList *)malloc(propsize);