title: AVAssetWriterInputPixelBufferAdaptor pixelBufferPool goes NULL after some time
body: <p>I'm using the pixelBufferPool within an AVAssetWriterInputPixelBufferAdaptor to create pixel buffers for use with the append method. After creating 4 buffers, the pixelBufferPool property becomes NULL;</p>
  
  <p>I setup my writer, input and adaptor like this:</p>
  
  <pre><code>- (BOOL) setupRecorder {
      NSError *error = nil;
      if([[NSFileManager defaultManager] fileExistsAtPath:[[self tempFileURL] path]])
          [[NSFileManager defaultManager] removeItemAtURL:[self tempFileURL] error:&amp;error];
  
  
      assetWriter = [[AVAssetWriter alloc] initWithURL: [self tempFileURL] 
                                              fileType:AVFileTypeQuickTimeMovie
                                                 error:&amp;error]; 
      if (error) {
          NSLog(@"Error creating asset writer: %@", error);
          [assetWriter release];
          return NO;
      }
      // writer
  
      NSDictionary *videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                                     AVVideoCodecH264, AVVideoCodecKey, 
                                     [NSNumber numberWithInt:videoWidth], AVVideoWidthKey, 
                                     [NSNumber numberWithInt:videoHeight], AVVideoHeightKey,
                                     nil];
  
      assetWriterInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo 
                                                        outputSettings:videoSettings];
  
      NSDictionary *bufferAttributes = [NSDictionary dictionaryWithObjectsAndKeys: 
                                        [NSNumber numberWithInt:kCVPixelFormatType_32BGRA], kCVPixelBufferPixelFormatTypeKey, 
                                        nil];
  
      adaptor = [[AVAssetWriterInputPixelBufferAdaptor alloc] initWithAssetWriterInput:assetWriterInput sourcePixelBufferAttributes:bufferAttributes];  
      [adaptor retain];
      assetWriterInput.expectsMediaDataInRealTime = YES;
      [assetWriter addInput:assetWriterInput];
  
      return YES;
  }
  </code></pre>
  
  <p>and I hand out pixel buffers with this:</p>
  
  <pre><code>- (CVPixelBufferRef) createPixelBufferRef {
      CVPixelBufferPoolRef pixelBufferPool = adaptor.pixelBufferPool;
      CVPixelBufferRef pixelBuffer = NULL;
      CVReturn cvReturn = CVPixelBufferPoolCreatePixelBuffer(NULL, pixelBufferPool, &amp;pixelBuffer);
      if(cvReturn != kCVReturnSuccess)
          NSLog(@"CVPixelBuffePoolCreatePixelBuffer: %d", cvReturn);
      bufferCreatedCount++;
      return pixelBuffer;
  }
  </code></pre>
  
  <p>when I'm done passing the pixel buffer to appendPixelBuffer i release the pixel buffer with CVPixelBufferRelease. At no point before this going NULL do I call markAsFinished, endSessionAtSourceTime or finishWriting. Further, the adaptor itself does not go NULL.</p>
  
  <p>Most posts I read talk about the pool being absent from the beginning due to a misconfigured adaptor, however mine is there, but only for a short time. Anyone else seen this behavior?</p>