[vlc-commits] audiounit_ios: Fill the remainder of the buffer with zeros

Martin Storsjö git at videolan.org
Sun Jul 28 18:38:07 CEST 2013


vlc | branch: master | Martin Storsjö <martin at martin.st> | Tue Jul 23 16:58:36 2013 +0300| [dc9879ba451bc17a1a494b049ba8fd6d7214ca27] | committer: Felix Paul Kühne

audiounit_ios: Fill the remainder of the buffer with zeros

If we didn't have enough data to fill the buffer, fill the rest
of it with zeros. This is better than playing back whatever happened
to be there from before.

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dc9879ba451bc17a1a494b049ba8fd6d7214ca27
---

 modules/audio_output/audiounit_ios.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/audio_output/audiounit_ios.c b/modules/audio_output/audiounit_ios.c
index 974d172..b780fd0 100644
--- a/modules/audio_output/audiounit_ios.c
+++ b/modules/audio_output/audiounit_ios.c
@@ -389,6 +389,8 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
         memcpy(targetBuffer, buffer, __MIN(bytesToCopy, availableBytes));
         TPCircularBufferConsume(&p_sys->circular_buffer, __MIN(bytesToCopy, availableBytes));
         VLC_UNUSED(inNumberFrames);
+        if (availableBytes < bytesToCopy)
+            memset((uint8_t*) targetBuffer + availableBytes, 0, bytesToCopy - availableBytes);
     }
 
     return noErr;



More information about the vlc-commits mailing list