Author: titmuss
Date: Tue Nov 18 12:51:37 2008
New Revision: 3401
URL: http://svn.slimdevices.com?rev=3401&root=Jive&view=rev
Log:
Bug: 9957
Description:
Fix audio on resume.
Modified:
7.3/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c
Modified: 7.3/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c
URL:
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c?rev=3401&root=Jive&r1=3400&r2=3401&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c
(original)
+++ 7.3/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c Tue
Nov 18 12:51:37 2008
@@ -304,10 +304,13 @@
snd_pcm_uframes_t offset;
snd_pcm_uframes_t frames, size;
snd_pcm_sframes_t avail, commitres;
+ snd_pcm_status_t *status;
int err, first = 1;
void *buf;
DEBUG_TRACE("audio_thread_execute");
+
+ status = malloc(snd_pcm_hw_params_sizeof());
while (1) {
fifo_lock(&decode_fifo);
@@ -344,6 +347,11 @@
}
first = 1;
continue;
+ }
+
+ /* this is needed to ensure the sound works on resume */
+ if (( err = snd_pcm_status(handle, status)) < 0) {
+ printf("snd_pcm_status err=%d\n", err);
}
if (avail < period_size) {
@@ -354,7 +362,8 @@
}
}
else {
- if ((err = snd_pcm_wait(handle, -1)) < 0) {
+ if ((err = snd_pcm_wait(handle, 500)) < 0) {
+ printf("err=%d\n", err);
if ((err = xrun_recovery(handle,
avail)) < 0) {
DEBUG_ERROR("PCM wait failed:
%s", snd_strerror(err));
}
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins