Commits

Dave Dribin  committed a9f6867

Actually allocate _mallocData. Fix printf format warning.

  • Participants
  • Parent commits f37536c

Comments (0)

Files changed (4)

File Source/DDAudioQueue.h

     RAAtomicListRef _bufferList;
     RAAtomicListRef _renderList;
     RAAtomicListRef _availableList;
-    NSMutableArray * _nodes;
-    NSMutableDictionary * _nodeDataByByteAddress;
     NSMutableDictionary * _mallocData;
-    NSMutableArray * _buffers2;
     DDAtomicListRef _bufferList2;
     DDAtomicListRef _renderList2;
     DDAtomicListRef _availableList2;
 
 - (DDAudioQueueBuffer *)allocateBufferWithCapacity:(NSUInteger)capacity error:(NSError **)error;
 
+- (void)deallocateBuffer:(DDAudioQueueBuffer *)buffer;
+
 - (BOOL)enqueueBuffer:(DDAudioQueueBuffer *)buffer;
 
 @end

File Source/DDAudioQueue.m

     
     _delegate = delegate;
     _buffers = [[NSMutableArray alloc] init];
+    _mallocData = [[NSMutableDictionary alloc] init];
     
     return self;
 }

File Source/DDAudioQueueReader.m

     }
     
     if (bytesRead < bytesToRead) {
-        printf("underflow: %u %u\n", bytesToRead, bytesRead);
+        printf("underflow: %u %u\n", (unsigned)bytesToRead, (unsigned)bytesRead);
     }
     
     return bytesRead;

File Tests/DDAudioQueueTest.m

     STAssertNotNil(buffer->bytes, nil);
 }
 
+- (void)testCanDeallocateBuffer
+{
+    DDAudioQueueBuffer * buffer = [self allocateBuffer];
+    [_queue deallocateBuffer:buffer];
+}
+
 - (void)testDequeuesBuffersInOrderTheyAreEnqeueued
 {
     [self allocateBuffers:2];