comparison decoders/voc.c @ 62:b13fafb976be

Changed _D macro to DBGSND.
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 24 Sep 2001 15:31:25 +0000
parents ea58bc3b15d7
children 40006625142a
comparison
equal deleted inserted replaced
61:7d3a6ea7f1f0 62:b13fafb976be
86 Uint8 channels; /* number of sound channels */ 86 Uint8 channels; /* number of sound channels */
87 int extended; /* Has an extended block been read? */ 87 int extended; /* Has an extended block been read? */
88 Uint32 bufpos; /* byte position in internal->buffer. */ 88 Uint32 bufpos; /* byte position in internal->buffer. */
89 } vs_t; 89 } vs_t;
90 90
91 /* Size field */ 91 /* Size field */
92 /* SJB: note that the 1st 3 are sometimes used as sizeof(type) */ 92 /* SJB: note that the 1st 3 are sometimes used as sizeof(type) */
93 #define ST_SIZE_BYTE 1 93 #define ST_SIZE_BYTE 1
94 #define ST_SIZE_8BIT 1 94 #define ST_SIZE_8BIT 1
95 #define ST_SIZE_WORD 2 95 #define ST_SIZE_WORD 2
96 #define ST_SIZE_16BIT 2 96 #define ST_SIZE_16BIT 2
185 if (block == VOC_TERM) 185 if (block == VOC_TERM)
186 return 1; 186 return 1;
187 187
188 if (SDL_RWread(src, bits24, sizeof (bits24), 1) != 1) 188 if (SDL_RWread(src, bits24, sizeof (bits24), 1) != 1)
189 return 1; /* assume that's the end of the file. */ 189 return 1; /* assume that's the end of the file. */
190 190
191 /* Size is an 24-bit value. Ugh. */ 191 /* Size is an 24-bit value. Ugh. */
192 sblen = ( (bits24[0]) | (bits24[1] << 8) | (bits24[2] << 16) ); 192 sblen = ( (bits24[0]) | (bits24[1] << 8) | (bits24[2] << 16) );
193 193
194 switch(block) 194 switch(block)
195 { 195 {
442 Sound_SetError("VOC data had no sound!"); 442 Sound_SetError("VOC data had no sound!");
443 free(v); 443 free(v);
444 return(0); 444 return(0);
445 } /* if */ 445 } /* if */
446 446
447 _D(("VOC: Accepting data stream.\n")); 447 SNDDBG(("VOC: Accepting data stream.\n"));
448 sample->actual.format = (v->size == ST_SIZE_WORD) ? AUDIO_S16LSB:AUDIO_U8; 448 sample->actual.format = (v->size == ST_SIZE_WORD) ? AUDIO_S16LSB:AUDIO_U8;
449 sample->actual.channels = v->channels; 449 sample->actual.channels = v->channels;
450 sample->flags = SOUND_SAMPLEFLAG_NONE; 450 sample->flags = SOUND_SAMPLEFLAG_NONE;
451 return(1); 451 return(1);
452 } /* VOC_open */ 452 } /* VOC_open */