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

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:58:36 2013 +0300| [9adaef96556472cef1dc472adb39cbf0c1b76d1a] | 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>
(cherry picked from commit dc9879ba451bc17a1a494b049ba8fd6d7214ca27)

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=9adaef96556472cef1dc472adb39cbf0c1b76d1a
---

 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