portable_sampleframe_t paintbuffer[PAINTBUFFER_SIZE];
// FIXME: this desyncs with the video too easily
-extern qboolean cl_capturevideo_active;
extern void SCR_CaptureVideo_SoundFrame(unsigned char *bufstereo16le, size_t length, int rate);
void S_CaptureAVISound(portable_sampleframe_t *buf, size_t length)
{
int n;
size_t i;
unsigned char out[PAINTBUFFER_SIZE * 4];
- if (!cl_capturevideo_active)
+ if (!cls.capturevideo_active)
return;
// write the sound buffer as little endian 16bit interleaved stereo
for(i = 0;i < length;i++)
{
// 1.0 mono
for (i = 0;i < snd_frames;i++, snd_p++)
+ {
val = ((snd_p->sample[0]+snd_p->sample[1]) >> 9) + 128;*snd_out++ = bound(0, val, 255);
+ }
}
}
}
sfx = ch->sfx;
if (!sfx)
continue;
- if (sfx->fetcher)
- j++;
for (j = 0;j < SND_LISTENERS;j++)
if (ch->listener_volume[j])
break;
if (ch->flags & CHANNELFLAG_FULLVOLUME)
snd_vol = 256;
else
- snd_vol = volume.value * 256;
+ snd_vol = (int)(volume.value * 256);
for (i = 0;i < SND_LISTENERS;i++)
vol[i] = ch->listener_volume[i] * snd_vol;