From 0d2f6491017839010cf2151f7f9a1962d84ad1c0 Mon Sep 17 00:00:00 2001 From: alexanderbollbach Date: Sun, 20 Dec 2015 17:38:53 -0500 Subject: [PATCH] moved source buffer struct member to local var in converter callback function --- .../project.pbxproj | 4 +- .../UserInterfaceState.xcuserstate | Bin 0 -> 14964 bytes .../xcschemes/CH06_AudioConverter.xcscheme | 91 ++++++++++++++++++ .../xcschemes/xcschememanagement.plist | 22 +++++ .../CH06_AudioConverter/main.c | 20 ++-- 5 files changed, 126 insertions(+), 11 deletions(-) create mode 100644 CH06_AudioConverter/CH06_AudioConverter.xcodeproj/project.xcworkspace/xcuserdata/alexanderbollbach.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 CH06_AudioConverter/CH06_AudioConverter.xcodeproj/xcuserdata/alexanderbollbach.xcuserdatad/xcschemes/CH06_AudioConverter.xcscheme create mode 100644 CH06_AudioConverter/CH06_AudioConverter.xcodeproj/xcuserdata/alexanderbollbach.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/project.pbxproj b/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/project.pbxproj index 972a65e..f43a8e5 100755 --- a/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/project.pbxproj +++ b/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/project.pbxproj @@ -190,7 +190,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx10.7; + SDKROOT = macosx10.11; }; name = Debug; }; @@ -199,7 +199,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx10.7; + SDKROOT = macosx10.11; }; name = Release; }; diff --git a/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/project.xcworkspace/xcuserdata/alexanderbollbach.xcuserdatad/UserInterfaceState.xcuserstate b/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/project.xcworkspace/xcuserdata/alexanderbollbach.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..20f05def2deb7c60752f22ad431425e62e0798d5 GIT binary patch literal 14964 zcmd6OcU;?5_x~NA009CSBxEoG2_X<5KnJvH%Wko>P*!(ifRx4tLX*&z&im0iI@MZh z-32J^lvu^9}eDWbcD*E`>@A;P33z9p|z4zQR-sjxYmM)Lm zAIQ%?iZCLGA`VGV1h6vCU=m%MO`ao%$#L=qIYHhhACM2pm*gb*iegGAr5u&e2pUPFsGKUOlIm#+O{FGk zrunph7Sd64G#x|7(jr<;D`+LHqBXRRPNxof9(B?d+DhB#`P567(q*)V^7I0FA>BYX z(oJ+T-Ab>b+vv4)2koV|(c9@AbT7S=?xRo8C+WZGQ}k*23_V1T(%0#m^lkbc{g8e_ zKc^?@H}n+!iT=(}j^iYpj?;4nE{RL#Qn*yk$fa@VoQX4Y8Jva7=L)z&ZWMPGSIJdz zleo!THFqvIg=^xPxf$F{u7zvm+Bg^I<+`}VTsPOlt>e~n8@P?!ChiJuD|Z#Qjk}iH z!R>4^cXoR`uOKOkMlmQB#Utg6X$^UcTs{8T@OMBXn$4{qr{CX)WGIdiM*EN)DHzAz zV@(dZxu~dgY~`r@s@zePW6N_#k1H<9Ev+0qHaCA%`IzFOqJo05v7;RFgzAdQ8D8Ha zf0wh>RpD*z?r?PmLJMn93bO1$iAaldNRJFC2_-WLi(ru~ib+{Ci`j!xkrCE6AQLj9 z3>M2|uoEeZXL{Daobv_h?#?#v(kh>`!{v~tK|`&t&E<2o4X)bgY$^A427F$R2UOl6 z&l$cYarRJuQ>S}zx2w7hcIjT=cKICgR2W{`8UVvEGDU}c!f=9Nt2qj)O3TJpjjGBW zS6EaEOsX1}JFd8NTyE9aQHABeuA-_!V3JNC5Ijbs*XwC<`l|iSZoj+511HiB^*LM0 z!nzVytjI0QG3FMm$}z4eC@dPAV=O8vTD9s(@K*CtV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dfxOx4tCrfV8B zO_~{+Hq8RfLe2RakET=8rSWMtY4&IiYTnd*o*0uTOVlT3BxWXNCE5~m6YYuP6VFbZ zkXVvfmRONkmDrVdY2sapA7~}o1Z}c5U2E1_v{r4oc9yn9>(wsNuGC(ny;QqiyHVS# z?bq(o?$O?&y-oYJ_7m+l+V8Zdv_EQp*8ZxC(nafHb#XeIE>|~RceZYVu0&U@o1&Yk zo2{Fxo3C4>>(F_1i*?uOcIqD1J)=9JdrSAW?p@vcx({_9>psJ#*KeYt*yet~|qev5vu{t5jX`uFu8=s(hbrT<$0t^Qa2Z~D`QNJEq% z+MqHd7&Hcx!D6r)Y=&He-B4_pXec$58!8Qx42_0ahB=0Lh89DcVS!;R?ex z!*;{9hMNq%hJM2?!#=|!hC_xI4KEvx7+y0RH=HoMW%xR2ankCfO-Yv}U6FKU(p5=U zCtZ_tUDB;dw3-zB5u#N>06=O!;rUYoowc|-E1y%N;K(ADJG-IWXdq*na(xMFwHeNOf9B%liTDmb(%Jr?lkQ) z9WXs%ddhUj^t|as(|4xd%o1~yImRqAro*1U>!a03~Qxzj&-4Rk+svh*cz}dv97gVYu#gg!1}OtzxAN?N$b^%Lvo)|1w6tlwLIu>O=qvSeA7taGyJv)Z%PWNpvdnRO`Z<*dV5?__t4-aC0;=KYfQyB*o7J;E-v$J%xFBzuZI&2F|^>{ffWz1AME-)Mive%OB8 z{+|6q`$_vL`!D&j{P=urz9Bz3KQ-T)Z_h8tAC*5gzc{}#e^P#Reog-S`KR)KDHy=$ Ogoq!wTf(t>0r`Jm=b4HC literal 0 HcmV?d00001 diff --git a/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/xcuserdata/alexanderbollbach.xcuserdatad/xcschemes/CH06_AudioConverter.xcscheme b/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/xcuserdata/alexanderbollbach.xcuserdatad/xcschemes/CH06_AudioConverter.xcscheme new file mode 100644 index 0000000..9472854 --- /dev/null +++ b/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/xcuserdata/alexanderbollbach.xcuserdatad/xcschemes/CH06_AudioConverter.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/xcuserdata/alexanderbollbach.xcuserdatad/xcschemes/xcschememanagement.plist b/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/xcuserdata/alexanderbollbach.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..d653b17 --- /dev/null +++ b/CH06_AudioConverter/CH06_AudioConverter.xcodeproj/xcuserdata/alexanderbollbach.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + CH06_AudioConverter.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 011C4AA114A505C300A35D5F + + primary + + + + + diff --git a/CH06_AudioConverter/CH06_AudioConverter/main.c b/CH06_AudioConverter/CH06_AudioConverter/main.c index 7ef8b84..5fe51b9 100755 --- a/CH06_AudioConverter/CH06_AudioConverter/main.c +++ b/CH06_AudioConverter/CH06_AudioConverter/main.c @@ -6,7 +6,7 @@ #endif -#define kInputFileLocation CFSTR("/Insert/Path/To/Audio/File.xxx") +#define kInputFileLocation CFSTR("/Users/alexanderbollbach/Desktop/qt.m4a") // #define kInputFileLocation CFSTR("/Users/kevin/Desktop/tmp_storage/audio_tests/cdsd_scratch.aiff") // #define kInputFileLocation CFSTR("/Volumes/Sephiroth/Tunes//菅野よう子/ESCAFLOWNE - ORIGINAL MOVIE SOUNDTRACK/We're flying.m4a") @@ -24,7 +24,7 @@ typedef struct MyAudioConverterSettings AudioStreamPacketDescription *inputFilePacketDescriptions; // array of packet descriptions for read buffer // KEVIN: sourceBuffer is never used outside of the callback. why couldn't it be a local there? - void *sourceBuffer; + } MyAudioConverterSettings; @@ -68,7 +68,9 @@ OSStatus MyAudioConverterCallback(AudioConverterRef inAudioConverter, AudioStreamPacketDescription **outDataPacketDescription, void *inUserData) { - MyAudioConverterSettings *audioConverterSettings = (MyAudioConverterSettings *)inUserData; +void *sourceBuffer = 0; + + MyAudioConverterSettings *audioConverterSettings = (MyAudioConverterSettings *)inUserData; // initialize in case of failure ioData->mBuffers[0].mData = NULL; @@ -81,13 +83,13 @@ OSStatus MyAudioConverterCallback(AudioConverterRef inAudioConverter, if(*ioDataPacketCount == 0) return noErr; - if (audioConverterSettings->sourceBuffer != NULL) + if (sourceBuffer != NULL) { - free(audioConverterSettings->sourceBuffer); - audioConverterSettings->sourceBuffer = NULL; + free(sourceBuffer); + sourceBuffer = NULL; } - audioConverterSettings->sourceBuffer = (void *)calloc(1, *ioDataPacketCount * audioConverterSettings->inputFilePacketMaxSize); + sourceBuffer = (void *)calloc(1, *ioDataPacketCount * audioConverterSettings->inputFilePacketMaxSize); UInt32 outByteCount = 0; OSStatus result = AudioFileReadPackets(audioConverterSettings->inputFile, @@ -96,7 +98,7 @@ OSStatus MyAudioConverterCallback(AudioConverterRef inAudioConverter, audioConverterSettings->inputFilePacketDescriptions, audioConverterSettings->inputFilePacketIndex, ioDataPacketCount, - audioConverterSettings->sourceBuffer); + sourceBuffer); // it's not an error if we just read the remainder of the file #ifdef MAC_OS_X_VERSION_10_7 @@ -120,7 +122,7 @@ OSStatus MyAudioConverterCallback(AudioConverterRef inAudioConverter, } */ // chris' hacky asssume-one-buffer equivalent - ioData->mBuffers[0].mData = audioConverterSettings->sourceBuffer; + ioData->mBuffers[0].mData = sourceBuffer; ioData->mBuffers[0].mDataByteSize = outByteCount; if (outDataPacketDescription)