comparison decoders/au.c @ 477:3e705c9180e5

Fixed binary compatibility, added Sound_GetDuration().
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 12 May 2004 02:15:00 +0000
parents c66080364dff
children 8a814bbbedfa
comparison
equal deleted inserted replaced
475:f0b8865577db 477:3e705c9180e5
244 BAIL_MACRO("AU: Not an .AU stream.", 0); 244 BAIL_MACRO("AU: Not an .AU stream.", 0);
245 } /* else */ 245 } /* else */
246 246
247 bytes_per_second = ( ( dec->encoding == AU_ENC_LINEAR_16 ) ? 2 : 1 ) 247 bytes_per_second = ( ( dec->encoding == AU_ENC_LINEAR_16 ) ? 2 : 1 )
248 * sample->actual.rate * sample->actual.channels ; 248 * sample->actual.rate * sample->actual.channels ;
249 sample->total_time = ((dec->remaining == -1) ? (-1) : 249 internal->total_time = ((dec->remaining == -1) ? (-1) :
250 ( ( dec->remaining / bytes_per_second ) * 1000 ) + 250 ( ( dec->remaining / bytes_per_second ) * 1000 ) +
251 ( ( dec->remaining % bytes_per_second ) * 1000 / 251 ( ( dec->remaining % bytes_per_second ) * 1000 /
252 bytes_per_second ) ); 252 bytes_per_second ) );
253 253
254 sample->flags = SOUND_SAMPLEFLAG_CANSEEK; 254 sample->flags = SOUND_SAMPLEFLAG_CANSEEK;
255 dec->total = dec->remaining; 255 dec->total = dec->remaining;
256 dec->start_offset = SDL_RWtell(rw); 256 dec->start_offset = SDL_RWtell(rw);
257 257