Mercurial > hg > xemacs-beta
comparison src/linuxplay.c @ 3963:d240e1ef5356
[xemacs-hg @ 2007-05-19 17:21:29 by vins]
Fix crash when playing sound on 64-bit linux systems under native sound.
author | vins |
---|---|
date | Sat, 19 May 2007 17:21:30 +0000 |
parents | ecf1ebac70d8 |
children | 5bc9d592760f |
comparison
equal
deleted
inserted
replaced
3962:23a3a480945b | 3963:d240e1ef5356 |
---|---|
321 /* Mainloop: read a block of data, parse its contents, perform all | 321 /* Mainloop: read a block of data, parse its contents, perform all |
322 the necessary conversions and output it to the sound | 322 the necessary conversions and output it to the sound |
323 device; repeat until all data has been processed */ | 323 device; repeat until all data has been processed */ |
324 rrtn = length; | 324 rrtn = length; |
325 do { | 325 do { |
326 for (pptr = data; (prtn = parsesndfile(&pptr,(size_t *)&rrtn,&optr)) > 0; ) | 326 for (pptr = data; (prtn = parsesndfile(&pptr,&rrtn,&optr)) > 0; ) |
327 for (cptr = optr; (crtn = sndcnv(&cptr,(size_t *) &prtn,&sptr)) > 0; ) { | 327 for (cptr = optr; (crtn = sndcnv(&cptr,&prtn,&sptr)) > 0; ) { |
328 for (;;) { | 328 for (;;) { |
329 if ((wrtn = write(audio_fd,sptr,crtn)) < 0) { | 329 if ((wrtn = write(audio_fd,sptr,crtn)) < 0) { |
330 sound_perror("write"); goto END_OF_PLAY; } | 330 sound_perror("write"); goto END_OF_PLAY; } |
331 else if (wrtn) break; | 331 else if (wrtn) break; |
332 else if (ioctl(audio_fd,SNDCTL_DSP_SYNC,NULL) < 0) { | 332 else if (ioctl(audio_fd,SNDCTL_DSP_SYNC,NULL) < 0) { |