[vlc-commits] Revert "audiounit_ios: try to handle data drops more efficiently"
Martin Storsjö
git at videolan.org
Sun Jul 28 18:39:18 CEST 2013
vlc/vlc-2.1 | branch: master | Martin Storsjö <martin at martin.st> | Tue Jul 23 16:39:30 2013 +0300| [fedf42b736718ce4a04d751aa186f098bc3e8fad] | committer: Felix Paul Kühne
Revert "audiounit_ios: try to handle data drops more efficiently"
This (more or less) reverts commit
2b7e016807507b632b8e0a7c874030bdffb2f604.
Stopping the aout from within the callback like this could
lead to deadlocks, where AudioOutputUnitStop in the callback thread
and AudioOutputUnitStart in the audio decoder thread blocked each
other (noticed at startup of playback on a 3GS with iOS 6.0).
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
(cherry picked from commit e720aa79c9977609e189f387d8a30f7410dc41be)
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=fedf42b736718ce4a04d751aa186f098bc3e8fad
---
modules/audio_output/audiounit_ios.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/audio_output/audiounit_ios.c b/modules/audio_output/audiounit_ios.c
index 1faaf58..974d172 100644
--- a/modules/audio_output/audiounit_ios.c
+++ b/modules/audio_output/audiounit_ios.c
@@ -383,8 +383,8 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
/* check if we have enough data */
if (!availableBytes) {
- /* bail out and restart unit the next time we receive some data */
- Flush(p_aout, false);
+ /* return an empty buffer so silence is played until we have data */
+ memset(targetBuffer, 0, bytesToCopy);
} else {
memcpy(targetBuffer, buffer, __MIN(bytesToCopy, availableBytes));
TPCircularBufferConsume(&p_sys->circular_buffer, __MIN(bytesToCopy, availableBytes));
More information about the vlc-commits
mailing list