Skip to content

Commit

Permalink
Moving processAudioBuffer in GPUImageMovieWriter to write the data on…
Browse files Browse the repository at this point in the history
… current queue
  • Loading branch information
eluzix committed Nov 6, 2013
1 parent 2dc08e0 commit 8818360
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions framework/Source/iOS/GPUImageMovieWriter.m
Original file line number Diff line number Diff line change
Expand Up @@ -342,22 +342,26 @@ - (void)processAudioBuffer:(CMSampleBufferRef)audioBuffer;
});
}

if (!assetWriterAudioInput.readyForMoreMediaData)
{
NSLog(@"Had to drop an audio frame");
return;
}
// if (!assetWriterAudioInput.readyForMoreMediaData)
// {
// NSLog(@"Had to drop an audio frame");
// return;
// }

// NSLog(@"Recorded audio sample time: %lld, %d, %lld", currentSampleTime.value, currentSampleTime.timescale, currentSampleTime.epoch);
dispatch_async(movieWritingQueue, ^{
[assetWriterAudioInput appendSampleBuffer:audioBuffer];

// dispatch_async(movieWritingQueue, ^{
if (assetWriterAudioInput.readyForMoreMediaData){
[assetWriterAudioInput appendSampleBuffer:audioBuffer];
} else {
NSLog(@"Had to drop an audio frame");
}

if (_shouldInvalidateAudioSampleWhenDone)
{
CMSampleBufferInvalidate(audioBuffer);
}
CFRelease(audioBuffer);
});
// });
}
}

Expand Down

0 comments on commit 8818360

Please sign in to comment.