comparison src/linuxplay.c @ 2271:0dfff19d20da

[xemacs-hg @ 2004-09-14 20:26:40 by james] Fix gcc 3.3 type-punning warnings.
author james
date Tue, 14 Sep 2004 20:26:46 +0000
parents 943eaba38521
children ecf1ebac70d8
comparison
equal deleted inserted replaced
2270:0be6ff2356c8 2271:0dfff19d20da
272 { 272 {
273 size_t (*parsesndfile)(void **dayta,size_t *sz,void **outbuf); 273 size_t (*parsesndfile)(void **dayta,size_t *sz,void **outbuf);
274 size_t (*sndcnv)(void **dayta,size_t *sz,void **); 274 size_t (*sndcnv)(void **dayta,size_t *sz,void **);
275 fmtType ffmt; 275 fmtType ffmt;
276 int fmt,speed,tracks; 276 int fmt,speed,tracks;
277 UChar_Binary *pptr,*optr,*cptr,*sptr; 277 void *pptr, *optr, *cptr, *sptr;
278 int wrtn,rrtn,crtn,prtn; 278 int wrtn,rrtn,crtn,prtn;
279 UChar_Binary sndbuf[SNDBUFSZ]; 279 UChar_Binary sndbuf[SNDBUFSZ];
280 280
281 /* We need to read at least the header information before we can start 281 /* We need to read at least the header information before we can start
282 doing anything */ 282 doing anything */
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((void **)&pptr,(size_t *)&rrtn, 326 for (pptr = data; (prtn = parsesndfile(&pptr,(size_t *)&rrtn,&optr)) > 0; )
327 (void **)&optr)) > 0; ) 327 for (cptr = optr; (crtn = sndcnv(&cptr,(size_t *) &prtn,&sptr)) > 0; ) {
328 for (cptr = optr; (crtn = sndcnv((void **)&cptr,(size_t *) &prtn,
329 (void **)&sptr)) > 0; ) {
330 for (;;) { 328 for (;;) {
331 if ((wrtn = write(audio_fd,sptr,crtn)) < 0) { 329 if ((wrtn = write(audio_fd,sptr,crtn)) < 0) {
332 sound_perror("write"); goto END_OF_PLAY; } 330 sound_perror("write"); goto END_OF_PLAY; }
333 else if (wrtn) break; 331 else if (wrtn) break;
334 else if (ioctl(audio_fd,SNDCTL_DSP_SYNC,NULL) < 0) { 332 else if (ioctl(audio_fd,SNDCTL_DSP_SYNC,NULL) < 0) {