Better fix for #309, now handles the case of missing only some voice
oggs but not all git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1009 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -490,18 +490,24 @@ SpliceTrack (UNICODE *TrackName, UNICODE *TrackText, UNICODE *TimeStamp, void (*
|
|||||||
// fprintf (stderr, "page (%d of %d): %d ts: %d\n",page_counter, num_pages, startTime, time_stamps[page_counter]);
|
// fprintf (stderr, "page (%d of %d): %d ts: %d\n",page_counter, num_pages, startTime, time_stamps[page_counter]);
|
||||||
if (last_chain->decoder)
|
if (last_chain->decoder)
|
||||||
{
|
{
|
||||||
//fprintf (stderr, " decoder: %s, rate %d format %x\n",
|
static float old_volume = 0.0f;
|
||||||
// last_chain->decoder->decoder_info,
|
if (last_chain->decoder->type == SOUNDDECODER_NULL)
|
||||||
// last_chain->decoder->frequency,
|
|
||||||
// last_chain->decoder->format);
|
|
||||||
|
|
||||||
if (last_chain->decoder->type == SOUNDDECODER_NULL &&
|
|
||||||
speechVolumeScale != 0.0f)
|
|
||||||
{
|
{
|
||||||
/* No voice ogg available so zeroing speech volume to
|
if (speechVolumeScale != 0.0f)
|
||||||
ensure proper operation of oscilloscope and music fading */
|
{
|
||||||
speechVolumeScale = 0.0f;
|
/* No voice ogg available so zeroing speech volume to
|
||||||
fprintf (stderr, "SpliceTrack(): no voice ogg available so setting speech volume to zero\n");
|
ensure proper operation of oscilloscope and music fading */
|
||||||
|
old_volume = speechVolumeScale;
|
||||||
|
speechVolumeScale = 0.0f;
|
||||||
|
fprintf (stderr, "SpliceTrack(): no voice ogg available so setting speech volume to zero\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (old_volume != 0.0f && speechVolumeScale != old_volume)
|
||||||
|
{
|
||||||
|
/* This time voice ogg is there */
|
||||||
|
fprintf (stderr, "SpliceTrack(): restoring speech volume\n");
|
||||||
|
speechVolumeScale = old_volume;
|
||||||
|
old_volume = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
sound_sample->length += last_chain->decoder->length;
|
sound_sample->length += last_chain->decoder->length;
|
||||||
|
|||||||
Reference in New Issue
Block a user