diff -Naru pulseaudio-0.9.5-orig/src/modules/module-alsa-sink.c pulseaudio-0.9.5/src/modules/module-alsa-sink.c
|
old
|
new
|
|
| 138 | 138 | return ret; |
| 139 | 139 | } |
| 140 | 140 | |
| | 141 | static int suspend_recovery(struct userdata *u) { |
| | 142 | int ret; |
| | 143 | assert(u); |
| | 144 | |
| | 145 | pa_log_info("*** ALSA-SUSPEND (playback) ***"); |
| | 146 | |
| | 147 | if ((ret = snd_pcm_prepare(u->pcm_handle)) < 0) { |
| | 148 | pa_log("snd_pcm_prepare() failed: %s", snd_strerror(-ret)); |
| | 149 | |
| | 150 | clear_up(u); |
| | 151 | pa_module_unload_request(u->module); |
| | 152 | return -1; |
| | 153 | } |
| | 154 | |
| | 155 | return ret; |
| | 156 | } |
| | 157 | |
| 141 | 158 | static void do_write(struct userdata *u) { |
| 142 | 159 | assert(u); |
| 143 | 160 | |
| … |
… |
|
| 169 | 186 | continue; |
| 170 | 187 | } |
| 171 | 188 | |
| | 189 | if (frames == -ESTRPIPE) { |
| | 190 | if (suspend_recovery(u) < 0) |
| | 191 | return; |
| | 192 | |
| | 193 | continue; |
| | 194 | } |
| | 195 | |
| 172 | 196 | pa_log("snd_pcm_writei() failed: %s", snd_strerror(-frames)); |
| 173 | 197 | |
| 174 | 198 | clear_up(u); |
| … |
… |
|
| 200 | 224 | if (xrun_recovery(u) < 0) |
| 201 | 225 | return; |
| 202 | 226 | |
| | 227 | if (snd_pcm_state(u->pcm_handle) == SND_PCM_STATE_SUSPENDED) |
| | 228 | if (suspend_recovery(u) < 0) |
| | 229 | return; |
| | 230 | |
| 203 | 231 | do_write(u); |
| 204 | 232 | } |
| 205 | 233 | |