AudioQueueFreeBuffer 警告
我收到 API AudioQueueFreeBuffer 的警告“AudioQueueObject::FreeBuffer: AQBuffer * 0x6273fd0 的排队计数为 1”...如何避免此警告?
我在 AudioQueueFreeBuffer API 中收到此警告
for (int i = 0; i < kNumberBuffers; ++i) {
if(mAudioInfo.mBuffers[i] != NULL)
{
AudioQueueFreeBuffer(mAudioInfo.mQueue, mAudioInfo.mBuffers[i]);
mAudioInfo.mBuffers[i] = NULL;
}
XThrowIfError(AudioQueueAllocateBuffer(mAudioInfo.mQueue, mBufferByteSize, &mAudioInfo.mBuffers[i]), "AudioQueueAllocateBuffer failed");
AQTestBufferCallback (&mAudioInfo, mAudioInfo.mQueue, mAudioInfo.mBuffers[i]);
if (mAudioInfo.mDone) break;
}
I am getting warning "AudioQueueObject::FreeBuffer: AQBuffer * 0x6273fd0 has enqueue count of 1" for API AudioQueueFreeBuffer... How to avoid this warning?
I am getting this warning in AudioQueueFreeBuffer API
for (int i = 0; i < kNumberBuffers; ++i) {
if(mAudioInfo.mBuffers[i] != NULL)
{
AudioQueueFreeBuffer(mAudioInfo.mQueue, mAudioInfo.mBuffers[i]);
mAudioInfo.mBuffers[i] = NULL;
}
XThrowIfError(AudioQueueAllocateBuffer(mAudioInfo.mQueue, mBufferByteSize, &mAudioInfo.mBuffers[i]), "AudioQueueAllocateBuffer failed");
AQTestBufferCallback (&mAudioInfo, mAudioInfo.mQueue, mAudioInfo.mBuffers[i]);
if (mAudioInfo.mDone) break;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您尝试对已在正在运行的 AudioQueue 中排队的缓冲区调用 AudioQueueFreeBuffer() 时,会发生这种情况。在尝试释放缓冲区之前,您应该在关联的 AudioQueue 上调用 AudioQueueStop()。
AudioQueueFreeBuffer() 的文档说:
This occurs when you attempt to call AudioQueueFreeBuffer() on a buffer that has been enqueued in an AudioQueue that is running. You should call AudioQueueStop() on the associated AudioQueue before attempting to free the buffers.
The doc's for AudioQueueFreeBuffer() say:
试试这个:
Try this: