mirror of
https://github.com/thes3m/XNI
synced 2024-12-26 13:26:06 +01:00
Fixed garbage creation in AudioContent.
git-svn-id: http://xni.googlecode.com/svn/XNI@121 ac433895-eea3-a490-d80a-17149a75e588
This commit is contained in:
parent
08abf7ffe0
commit
63ea4cf7e3
@ -21,7 +21,6 @@
|
|||||||
int loopStart;
|
int loopStart;
|
||||||
|
|
||||||
@private
|
@private
|
||||||
NSURL *fileUrl;
|
|
||||||
ExtAudioFileRef extRef;
|
ExtAudioFileRef extRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
fileName = theFileName;
|
fileName = [theFileName retain];
|
||||||
fileType = theFileType;
|
fileType = theFileType;
|
||||||
|
|
||||||
// Load file.
|
// Load file.
|
||||||
@ -25,10 +25,12 @@
|
|||||||
UInt32 thePropertySize = sizeof(theFileFormat);
|
UInt32 thePropertySize = sizeof(theFileFormat);
|
||||||
|
|
||||||
// Open a file with ExtAudioFileOpen().
|
// Open a file with ExtAudioFileOpen().
|
||||||
fileUrl = [[NSURL fileURLWithPath:theFileName] retain];
|
NSURL *fileUrl = [NSURL fileURLWithPath:theFileName];
|
||||||
extRef = nil;
|
|
||||||
|
extRef = nil;
|
||||||
err = ExtAudioFileOpenURL((CFURLRef)fileUrl, &extRef);
|
err = ExtAudioFileOpenURL((CFURLRef)fileUrl, &extRef);
|
||||||
if (err) {
|
|
||||||
|
if (err) {
|
||||||
[NSException raise:@"NotSupportedException" format:@"ExtAudioFileOpenURL FAILED, Error = %ld\n", err];
|
[NSException raise:@"NotSupportedException" format:@"ExtAudioFileOpenURL FAILED, Error = %ld\n", err];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,9 +113,9 @@
|
|||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
//if (extRef) ExtAudioFileDispose(extRef);
|
if (extRef) ExtAudioFileDispose(extRef);
|
||||||
[format release];
|
[format release];
|
||||||
[fileUrl release];
|
[fileName release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user