You should actually be able to set errno to 0 *before* the first call, and it should never return failure unless there was actually a real problem with permissions, etc.
-DS > On Oct 13, 2016, at 3:46 PM, down to this <downtot...@gmail.com> wrote: > > Just wanted to follow up regarding this. As per the work-around the Douglas > Scott suggested below, I've implemented this successfully in my app and it is > working without issues. > > For those who are unaware (as I was), the 'errno' value can simply be set > directly. By updating the "errno" value to 0 after a failed call, subsequent > calls to 'MusicSequenceFileLoad' generate a successful response. Therefore, > I've amended my code as follows: > > OSStatus statusOfInitialAttempt = > CheckError(MusicSequenceFileLoad(self.masterMidiMusicSequence, (__bridge > CFURLRef)midiFileURL, 0, 0), "MusicSequenceFileLoad"); > if (statusOfInitialAttempt == -1) { > errno = 0; > > OSStatus statusOfSecondAttempt = > CheckErrorAndReturnOnFailure(MusicSequenceFileLoad(self.masterMidiMusicSequence, > (__bridge CFURLRef)midiFileURL, 0, 0), "MusicSequenceFileLoad"); > > if (statusOfSecondAttempt == -1) { > // Handle error case > } > } > Thanks Douglas for your help with this! > > Best, > > Derek > > > Date: Sun, 09 Oct 2016 22:15:03 -0700 > From: Douglas Scott <douglas_sc...@apple.com <mailto:douglas_sc...@apple.com>> > To: Sven Thoennissen <bioch...@me.com <mailto:bioch...@me.com>> > Cc: coreaudio-api@lists.apple.com <mailto:coreaudio-api@lists.apple.com> > Subject: Re: MusicSequenceFileLoad Returns -1 on iOS10 > (AudioToolbox/MusicPlayer) > Message-ID: <43be2217-7a15-4f03-9338-728acd0ff...@apple.com > <mailto:43be2217-7a15-4f03-9338-728acd0ff...@apple.com>> > Content-Type: text/plain; charset="utf-8" > > I cannot promise the specific release in which this will be fixed, but the > problem is understood, and I can tell you that if you can force ‘errno’ to > reset to 0, any following call to MusicSequenceFileLoadData() will succeed. > > -DS > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Coreaudio-api mailing list (Coreaudio-api@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/coreaudio-api/douglas_scott%40apple.com > > This email sent to douglas_sc...@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (Coreaudio-api@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com This email sent to arch...@mail-archive.com