0011-Revert-audiounit_ios-try-to-handle-data-drops-more-e.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 088da4f6c2f44e725e9c4ab3166010ff32cfab71 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
  3. Date: Tue, 23 Jul 2013 16:39:30 +0300
  4. Subject: [PATCH 11/13] Revert "audiounit_ios: try to handle data drops more
  5. efficiently"
  6. This (more or less) reverts commit
  7. 2b7e016807507b632b8e0a7c874030bdffb2f604.
  8. Stopping the aout from within the callback like this could
  9. lead to deadlocks, where AudioOutputUnitStop in the callback thread
  10. and AudioOutputUnitStart in the audio decoder thread blocked each
  11. other (noticed at startup of playback on a 3GS with iOS 6.0).
  12. ---
  13. modules/audio_output/audiounit_ios.c | 4 ++--
  14. 1 file changed, 2 insertions(+), 2 deletions(-)
  15. diff --git a/modules/audio_output/audiounit_ios.c b/modules/audio_output/audiounit_ios.c
  16. index 1faaf58..974d172 100644
  17. --- a/modules/audio_output/audiounit_ios.c
  18. +++ b/modules/audio_output/audiounit_ios.c
  19. @@ -383,8 +383,8 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
  20. /* check if we have enough data */
  21. if (!availableBytes) {
  22. - /* bail out and restart unit the next time we receive some data */
  23. - Flush(p_aout, false);
  24. + /* return an empty buffer so silence is played until we have data */
  25. + memset(targetBuffer, 0, bytesToCopy);
  26. } else {
  27. memcpy(targetBuffer, buffer, __MIN(bytesToCopy, availableBytes));
  28. TPCircularBufferConsume(&p_sys->circular_buffer, __MIN(bytesToCopy, availableBytes));
  29. --
  30. 1.7.12.4 (Apple Git-37)