comparison decoders/wav.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 2df1f5c62d38
comparison
equal deleted inserted replaced
475:f0b8865577db 477:3e705c9180e5
722 fmt->data_starting_offset = SDL_RWtell(rw); 722 fmt->data_starting_offset = SDL_RWtell(rw);
723 fmt->sample_frame_size = ( ((sample->actual.format & 0xFF) / 8) * 723 fmt->sample_frame_size = ( ((sample->actual.format & 0xFF) / 8) *
724 sample->actual.channels ); 724 sample->actual.channels );
725 internal->decoder_private = (void *) w; 725 internal->decoder_private = (void *) w;
726 726
727 sample->total_time = (fmt->total_bytes / fmt->dwAvgBytesPerSec) * 1000; 727 internal->total_time = (fmt->total_bytes / fmt->dwAvgBytesPerSec) * 1000;
728 sample->total_time += (fmt->total_bytes % fmt->dwAvgBytesPerSec) 728 internal->total_time += (fmt->total_bytes % fmt->dwAvgBytesPerSec)
729 * 1000 / fmt->dwAvgBytesPerSec; 729 * 1000 / fmt->dwAvgBytesPerSec;
730 730
731 sample->flags = SOUND_SAMPLEFLAG_NONE; 731 sample->flags = SOUND_SAMPLEFLAG_NONE;
732 if (fmt->seek_sample != NULL) 732 if (fmt->seek_sample != NULL)
733 sample->flags |= SOUND_SAMPLEFLAG_CANSEEK; 733 sample->flags |= SOUND_SAMPLEFLAG_CANSEEK;
734 734