File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1204,14 +1204,28 @@ int audio_flush (int a)
1204
1204
1205
1205
snd_pcm_recover (adev [a ].audio_out_handle , k , 1 );
1206
1206
}
1207
+ else if (k == - ESTRPIPE ) {
1208
+ text_color_set (DW_COLOR_ERROR );
1209
+ dw_printf ("Driver suspended, recovering\n" );
1210
+ snd_pcm_recover (adev [a ].audio_out_handle , k , 1 );
1211
+ }
1212
+ else if (k == - EBADFD ) {
1213
+ k = snd_pcm_prepare (adev [a ].audio_out_handle );
1214
+ if (k < 0 ) {
1215
+ dw_printf ("Error preparing after bad state: %s\n" , snd_strerror (k ));
1216
+ }
1217
+ }
1207
1218
else if (k < 0 ) {
1208
1219
text_color_set (DW_COLOR_ERROR );
1209
1220
dw_printf ("Audio write error: %s\n" , snd_strerror (k ));
1210
1221
1211
1222
/* Some other error condition. */
1212
1223
/* Try again. What do we have to lose? */
1213
1224
1214
- snd_pcm_recover (adev [a ].audio_out_handle , k , 1 );
1225
+ k = snd_pcm_prepare (adev [a ].audio_out_handle );
1226
+ if (k < 0 ) {
1227
+ dw_printf ("Error preparing after error: %s\n" , snd_strerror (k ));
1228
+ }
1215
1229
}
1216
1230
else if (k != adev [a ].outbuf_len / adev [a ].bytes_per_frame ) {
1217
1231
text_color_set (DW_COLOR_ERROR );
You can’t perform that action at this time.
0 commit comments