0012-audiounit_ios-Fill-the-remainder-of-the-buffer-with-.patch 1.1 KB

123456789101112131415161718192021222324252627282930
  1. From 9b81c559d754f5e75b61fbc43e1c467d89bb9f10 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:58:36 +0300
  4. Subject: [PATCH 12/13] audiounit_ios: Fill the remainder of the buffer with
  5. zeros
  6. If we didn't have enough data to fill the buffer, fill the rest
  7. of it with zeros. This is better than playing back whatever happened
  8. to be there from before.
  9. ---
  10. modules/audio_output/audiounit_ios.c | 2 ++
  11. 1 file changed, 2 insertions(+)
  12. diff --git a/modules/audio_output/audiounit_ios.c b/modules/audio_output/audiounit_ios.c
  13. index 974d172..b780fd0 100644
  14. --- a/modules/audio_output/audiounit_ios.c
  15. +++ b/modules/audio_output/audiounit_ios.c
  16. @@ -389,6 +389,8 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
  17. memcpy(targetBuffer, buffer, __MIN(bytesToCopy, availableBytes));
  18. TPCircularBufferConsume(&p_sys->circular_buffer, __MIN(bytesToCopy, availableBytes));
  19. VLC_UNUSED(inNumberFrames);
  20. + if (availableBytes < bytesToCopy)
  21. + memset((uint8_t*) targetBuffer + availableBytes, 0, bytesToCopy - availableBytes);
  22. }
  23. return noErr;
  24. --
  25. 1.7.12.4 (Apple Git-37)