#include "quakedef.h"
#include "snd_main.h"
-typedef struct
+typedef struct portable_samplepair_s
{
int left;
int right;
// FIXME: this desyncs with the video too easily
extern qboolean cl_capturevideo_active;
-extern void SCR_CaptureVideo_SoundFrame(qbyte *bufstereo16le, size_t length, int rate);
+extern void SCR_CaptureVideo_SoundFrame(unsigned char *bufstereo16le, size_t length, int rate);
void S_CaptureAVISound(portable_samplepair_t *buf, size_t length)
{
int n;
size_t i;
- qbyte out[PAINTBUFFER_SIZE * 4];
+ unsigned char out[PAINTBUFFER_SIZE * 4];
if (!cl_capturevideo_active)
return;
// write the sound buffer as little endian 16bit interleaved stereo
// if the channel is paused
if (ch->flags & CHANNELFLAG_PAUSED)
{
- size_t pausedtime;
-
- pausedtime = end - paintedtime;
+ int pausedtime = end - paintedtime;
ch->lastptime += pausedtime;
ch->end += pausedtime;
continue;
// paint up to end
if (ch->end < end)
- count = ch->end - ltime;
+ count = (int)ch->end - ltime;
else
count = end - ltime;
// Stereo sound support
if (ch->sfx->format.channels == 2)
{
- sfx = sb->data + (ch->pos - sb->offset) * 2;
+ sfx = (signed char *)sb->data + (ch->pos - sb->offset) * 2;
for (i = 0;i < count;i++)
{
paintbuffer[i].left += (*sfx++ * leftvol) >> 8;
}
else
{
- sfx = sb->data + ch->pos - sb->offset;
+ sfx = (signed char *)sb->data + ch->pos - sb->offset;
for (i = 0;i < count;i++)
{
paintbuffer[i].left += (*sfx * leftvol) >> 8;
paintbuffer[i].right += (*sfx++ * rightvol) >> 8;
}
-
}
ch->pos += count;
return true;