static dllhandle_t og_dll = NULL, vo_dll = NULL, ve_dll = NULL, th_dll = NULL;
-qboolean SCR_CaptureVideo_Ogg_OpenLibrary(void)
+static qboolean SCR_CaptureVideo_Ogg_OpenLibrary(void)
{
const char* dllnames_og [] =
{
format->videopage.len = pg.header_len + pg.body_len;
format->videopage.time = qtheora_granule_time(&format->ts, qogg_page_granulepos(&pg));
if(format->videopage.len > sizeof(format->videopage.data))
- Host_Error("video page too long");
+ Sys_Error("video page too long");
memcpy(format->videopage.data, pg.header, pg.header_len);
memcpy(format->videopage.data + pg.header_len, pg.body, pg.body_len);
}
format->audiopage.len = pg.header_len + pg.body_len;
format->audiopage.time = qvorbis_granule_time(&format->vd, qogg_page_granulepos(&pg));
if(format->audiopage.len > sizeof(format->audiopage.data))
- Host_Error("audio page too long");
+ Sys_Error("audio page too long");
memcpy(format->audiopage.data, pg.header, pg.header_len);
memcpy(format->audiopage.data + pg.header_len, pg.body, pg.body_len);
}
while (1) {
int result = qogg_stream_flush (&format->to, &pg);
if (result < 0)
- fprintf (stderr, "Internal Ogg library error.\n"); // TODO Host_Error
+ fprintf (stderr, "Internal Ogg library error.\n"); // TODO Sys_Error
if (result <= 0)
break;
FS_Write(cls.capturevideo.videofile, pg.header, pg.header_len);
while (1) {
int result = qogg_stream_flush (&format->vo, &pg);
if (result < 0)
- fprintf (stderr, "Internal Ogg library error.\n"); // TODO Host_Error
+ fprintf (stderr, "Internal Ogg library error.\n"); // TODO Sys_Error
if (result <= 0)
break;
FS_Write(cls.capturevideo.videofile, pg.header, pg.header_len);
yuv_buffer *yuv;
int x, y;
int blockr, blockg, blockb;
- unsigned char *b = cls.capturevideo.outbuffer;
+ unsigned char *b;
int w = cls.capturevideo.width;
int h = cls.capturevideo.height;
int inpitch = w*4;
ogg_packet pt;
int *map = mapping[bound(1, cls.capturevideo.soundchannels, 8) - 1];
- vorbis_buffer = qvorbis_analysis_buffer(&format->vd, length);
+ vorbis_buffer = qvorbis_analysis_buffer(&format->vd, (int)length);
for(j = 0; j < cls.capturevideo.soundchannels; ++j)
{
float *b = vorbis_buffer[map[j]];
for(i = 0; i < length; ++i)
- b[i] = paintbuffer[i].sample[j] / 32768.0f;
+ b[i] = paintbuffer[i].sample[j];
}
- qvorbis_analysis_wrote(&format->vd, length);
+ qvorbis_analysis_wrote(&format->vd, (int)length);
while(qvorbis_analysis_blockout(&format->vd, &format->vb) == 1)
{
void SCR_CaptureVideo_Ogg_BeginVideo(void)
{
+ char vabuf[1024];
cls.capturevideo.format = CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA;
cls.capturevideo.formatextension = "ogv";
- cls.capturevideo.videofile = FS_OpenRealFile(va("%s.%s", cls.capturevideo.basename, cls.capturevideo.formatextension), "wb", false);
+ cls.capturevideo.videofile = FS_OpenRealFile(va(vabuf, sizeof(vabuf), "%s.%s", cls.capturevideo.basename, cls.capturevideo.formatextension), "wb", false);
cls.capturevideo.endvideo = SCR_CaptureVideo_Ogg_EndVideo;
cls.capturevideo.videoframes = SCR_CaptureVideo_Ogg_VideoFrames;
cls.capturevideo.soundframe = SCR_CaptureVideo_Ogg_SoundFrame;
{
int result = qogg_stream_flush (&format->to, &pg);
if (result < 0)
- fprintf (stderr, "Internal Ogg library error.\n"); // TODO Host_Error
+ fprintf (stderr, "Internal Ogg library error.\n"); // TODO Sys_Error
if (result <= 0)
break;
FS_Write(cls.capturevideo.videofile, pg.header, pg.header_len);
{
int result = qogg_stream_flush (&format->vo, &pg);
if (result < 0)
- fprintf (stderr, "Internal Ogg library error.\n"); // TODO Host_Error
+ fprintf (stderr, "Internal Ogg library error.\n"); // TODO Sys_Error
if (result <= 0)
break;
FS_Write(cls.capturevideo.videofile, pg.header, pg.header_len);