[vlc-commits] audioqueue: fixed potential TimeGet issue
Rafaël Carré
git at videolan.org
Mon Feb 4 19:35:54 CET 2013
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Feb 4 19:35:23 2013 +0100| [08ec492002a8ef7937dcbf946f63fe260035e5e9] | committer: Felix Paul Kühne
audioqueue: fixed potential TimeGet issue
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=08ec492002a8ef7937dcbf946f63fe260035e5e9
---
modules/audio_output/audioqueue.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/audio_output/audioqueue.c b/modules/audio_output/audioqueue.c
index 108b122..59ebcf7 100644
--- a/modules/audio_output/audioqueue.c
+++ b/modules/audio_output/audioqueue.c
@@ -167,12 +167,14 @@ static void Play (audio_output_t *p_aout, block_t *p_block)
memcpy(inBuffer->mAudioData, p_block->p_buffer, p_block->i_buffer);
inBuffer->mAudioDataByteSize = p_block->i_buffer;
- p_aout->sys->i_played_length += p_block->i_length;
- block_Release(p_block);
status = AudioQueueEnqueueBuffer(p_aout->sys->audioQueue, inBuffer, 0, NULL);
- if (status != noErr)
+ if (status == noErr)
+ p_aout->sys->i_played_length += p_block->i_length;
+ else
msg_Err(p_aout, "enqueuing buffer failed (%li)", status);
+
+ block_Release(p_block);
}
void AudioQueueCallback(void * inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer) {
More information about the vlc-commits
mailing list