X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=cap_avi.c;h=ea0e35445a4be10f3959c012cd9955f7eb2f11eb;hp=486243645860d80488191e9d9249d26f05999648;hb=9becec9419d9a20c7d373b14e1106d5f0ce78494;hpb=167d174d353c234a4f965a0bc1e4478e1a5cff86 diff --git a/cap_avi.c b/cap_avi.c index 48624364..ea0e3544 100644 --- a/cap_avi.c +++ b/cap_avi.c @@ -18,7 +18,7 @@ typedef struct capturevideostate_avi_formatspecific_s fs_offset_t videofile_ix_master_video_start_offset; fs_offset_t videofile_ix_movistart; fs_offset_t position; - qboolean canseek; + qbool canseek; sizebuf_t riffbuffer; unsigned char riffbufferdata[128]; sizebuf_t riffindexbuffer; @@ -147,7 +147,7 @@ static void SCR_CaptureVideo_RIFF_Pop(void) if(sizehint != -1) { int i; - Con_Printf("WARNING: invalid size hint %d when writing video data (actual size: %d)\n", (int) sizehint, x); + Con_Printf(CON_WARN "WARNING: invalid size hint %d when writing video data (actual size: %d)\n", (int) sizehint, x); for(i = 0; i <= format->riffstacklevel; ++i) { Con_Printf(" RIFF level %d = %s\n", i, format->riffstackfourcc[i]); @@ -188,7 +188,7 @@ static void SCR_CaptureVideo_RIFF_IndexEntry(const char *chunkfourcc, int chunks { LOAD_FORMATSPECIFIC_AVI(); if(!format->canseek) - Host_Error("SCR_CaptureVideo_RIFF_IndexEntry called on non-seekable AVI"); + Sys_Error("SCR_CaptureVideo_RIFF_IndexEntry called on non-seekable AVI"); if (format->riffstacklevel != 2) Sys_Error("SCR_Capturevideo_RIFF_IndexEntry: RIFF stack level is %i (should be 2)\n", format->riffstacklevel); @@ -209,7 +209,7 @@ static void SCR_CaptureVideo_RIFF_MakeIxChunk(const char *fcc, const char *dwChu fs_offset_t pos, sz; if(!format->canseek) - Host_Error("SCR_CaptureVideo_RIFF_MakeIxChunk called on non-seekable AVI"); + Sys_Error("SCR_CaptureVideo_RIFF_MakeIxChunk called on non-seekable AVI"); if(*masteridx_count >= AVI_MASTER_INDEX_SIZE) return; @@ -269,7 +269,7 @@ static void SCR_CaptureVideo_RIFF_MakeIxChunk(const char *fcc, const char *dwChu FS_Seek(cls.capturevideo.videofile, 0, SEEK_END); // return value doesn't matter here } -static void SCR_CaptureVideo_RIFF_Finish(qboolean final) +static void SCR_CaptureVideo_RIFF_Finish(qbool final) { LOAD_FORMATSPECIFIC_AVI(); // close the "movi" list @@ -404,7 +404,7 @@ static void SCR_CaptureVideo_Avi_VideoFrames(int num) } } -void SCR_CaptureVideo_Avi_EndVideo(void) +static void SCR_CaptureVideo_Avi_EndVideo(void) { LOAD_FORMATSPECIFIC_AVI(); @@ -449,7 +449,7 @@ void SCR_CaptureVideo_Avi_EndVideo(void) Mem_Free(format); } -void SCR_CaptureVideo_Avi_SoundFrame(const portable_sampleframe_t *paintbuffer, size_t length) +static void SCR_CaptureVideo_Avi_SoundFrame(const portable_sampleframe_t *paintbuffer, size_t length) { LOAD_FORMATSPECIFIC_AVI(); int x; @@ -473,7 +473,7 @@ void SCR_CaptureVideo_Avi_SoundFrame(const portable_sampleframe_t *paintbuffer, out_ptr[3] = (unsigned char)(n1 >> 8); } - x = length*4; + x = (int)length*4; if(format->canseek) { SCR_CaptureVideo_RIFF_OverflowCheck(8 + x); @@ -502,12 +502,13 @@ void SCR_CaptureVideo_Avi_BeginVideo(void) int n, d; unsigned int i; double aspect; + char vabuf[1024]; aspect = vid.width / (vid.height * vid_pixelheight.value); cls.capturevideo.format = CAPTUREVIDEOFORMAT_AVI_I420; cls.capturevideo.formatextension = "avi"; - 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_Avi_EndVideo; cls.capturevideo.videoframes = SCR_CaptureVideo_Avi_VideoFrames; cls.capturevideo.soundframe = SCR_CaptureVideo_Avi_SoundFrame;