OSX: Set mDataByteSize correctly on AudioBuffers during render.

This commit is contained in:
Gregory Smith 2012-10-02 08:18:41 -07:00 committed by Max Kellermann
parent 9994521b8c
commit 03a401e477
2 changed files with 8 additions and 3 deletions

1
NEWS
View File

@ -1,5 +1,6 @@
ver 0.17.3 (2012/??/??) ver 0.17.3 (2012/??/??)
* output: * output:
- osx: fix pops during playback
- recorder: fix I/O error check - recorder: fix I/O error check
- shout: fix memory leak in error handler - shout: fix memory leak in error handler
- recorder, shout: support Ogg packets that span more than one page - recorder, shout: support Ogg packets that span more than one page

View File

@ -228,9 +228,13 @@ osx_render(void *vdata,
g_cond_signal(od->condition); g_cond_signal(od->condition);
g_mutex_unlock(od->mutex); g_mutex_unlock(od->mutex);
if (nbytes < buffer_size) buffer->mDataByteSize = nbytes;
memset((unsigned char*)buffer->mData + nbytes, 0,
buffer_size - nbytes); unsigned i;
for (i = 1; i < buffer_list->mNumberBuffers; ++i) {
buffer = &buffer_list->mBuffers[i];
buffer->mDataByteSize = 0;
}
return 0; return 0;
} }