Author: titmuss
Date: Wed May 14 01:13:54 2008
New Revision: 2451
URL: http://svn.slimdevices.com?rev=2451&root=Jive&view=rev
Log:
Bug: N/A
Description:
Correctly handle audio underruns.
Modified:
7.2/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
7.2/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_portaudio.c
Modified: 7.2/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
URL:
http://svn.slimdevices.com/7.2/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua?rev=2451&root=Jive&r1=2450&r2=2451&view=diff
==============================================================================
--- 7.2/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
(original)
+++ 7.2/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua Wed May
14 01:13:54 2008
@@ -138,7 +138,7 @@
-- when XXXX
if not self.sentAudioUnderrunEvent and
- self.sentDecoderUnderrrunEvent then
+ self.sentDecoderUnderrunEvent then
log:info("status AUDIO UNDERRUN")
self:sendStatus(status, "STMu")
Modified:
7.2/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_portaudio.c
URL:
http://svn.slimdevices.com/7.2/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_portaudio.c?rev=2451&root=Jive&r1=2450&r2=2451&view=diff
==============================================================================
--- 7.2/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_portaudio.c
(original)
+++ 7.2/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_portaudio.c
Wed May 14 01:13:54 2008
@@ -62,13 +62,19 @@
}
/* audio underrun? */
- // XXXX we must empty the output buffer to allow audio underruns
- if (bytes_used < len) {
+ if (bytes_used == 0) {
current_audio_state |= DECODE_STATE_UNDERRUN;
memset(outputBuffer, 0, len);
return 0;
}
- current_audio_state &= ~DECODE_STATE_UNDERRUN;
+
+ if (bytes_used < len) {
+ current_audio_state |= DECODE_STATE_UNDERRUN;
+ memset(outputBuffer + bytes_used, 0, len - bytes_used);
+ }
+ else {
+ current_audio_state &= ~DECODE_STATE_UNDERRUN;
+ }
outputArray = (u8_t *)outputBuffer;
while (bytes_used) {
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins