* this should fix the slider length to be correct for all samples
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@589 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -280,11 +280,11 @@ TFB_SoundDecoder* SoundDecoder_Load (char *filename, uint32 buffer_size,
|
||||
decoder->frequency = vinfo->rate;
|
||||
decoder->looping = false;
|
||||
decoder->error = SOUNDDECODER_OK;
|
||||
decoder->length = (float) ov_time_total (vf, -1);
|
||||
decoder->length = (float) ov_time_total (vf, -1) - (startTime / 1000.0f);
|
||||
if (runTime && runTime / 1000.0 < decoder->length)
|
||||
decoder->length = (float)(runTime / 1000.0);
|
||||
|
||||
decoder->start_sample = decoder->frequency * startTime/1000;
|
||||
decoder->start_sample = decoder->frequency * startTime / 1000;
|
||||
decoder->end_sample = decoder->start_sample +
|
||||
(unsigned long)(decoder->length * decoder->frequency);
|
||||
if (decoder->start_sample)
|
||||
|
||||
@@ -248,11 +248,11 @@ TFB_SoundDecoder* SoundDecoder_Load (char *filename, ALuint buffer_size, unsigne
|
||||
decoder->frequency = vinfo->rate;
|
||||
decoder->looping = AL_FALSE;
|
||||
decoder->error = SOUNDDECODER_OK;
|
||||
decoder->length = (float) ov_time_total (vf, -1);
|
||||
decoder->length = (float) ov_time_total (vf, -1) - (startTime / 1000.0f);
|
||||
if (runTime && runTime / 1000.0 < decoder->length)
|
||||
decoder->length = (float)(runTime / 1000.0);
|
||||
|
||||
decoder->start_sample = decoder->frequency * startTime/1000;
|
||||
decoder->start_sample = decoder->frequency * startTime / 1000;
|
||||
decoder->end_sample = decoder->start_sample +
|
||||
(unsigned long)(decoder->length * decoder->frequency);
|
||||
if (decoder->start_sample)
|
||||
|
||||
Reference in New Issue
Block a user