X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=cap_ogg.c;h=424eac411774344d2f27fbd731c10c8783aa6dd4;hp=159457d95e55f58675e0497f55909679b6bbaee1;hb=b580442d0be79e1c4c78b9cb568fe30cf3e03f76;hpb=48dd57adb791a8866bc12f96ad81e2c7712fae7a diff --git a/cap_ogg.c b/cap_ogg.c index 159457d9..424eac41 100644 --- a/cap_ogg.c +++ b/cap_ogg.c @@ -517,13 +517,11 @@ static dllfunction_t theorafuncs[] = static dllhandle_t og_dll = NULL, vo_dll = NULL, ve_dll = NULL, th_dll = NULL; -qboolean SCR_CaptureVideo_Ogg_OpenLibrary() +qboolean SCR_CaptureVideo_Ogg_OpenLibrary(void) { const char* dllnames_og [] = { -#if defined(WIN64) - "libogg64.dll", -#elif defined(WIN32) +#if defined(WIN32) "libogg.dll", "ogg.dll", #elif defined(MACOSX) @@ -536,9 +534,7 @@ qboolean SCR_CaptureVideo_Ogg_OpenLibrary() }; const char* dllnames_vo [] = { -#if defined(WIN64) - "libvorbis64.dll", -#elif defined(WIN32) +#if defined(WIN32) "libvorbis.dll", "vorbis.dll", #elif defined(MACOSX) @@ -551,9 +547,7 @@ qboolean SCR_CaptureVideo_Ogg_OpenLibrary() }; const char* dllnames_ve [] = { -#if defined(WIN64) - "libvorbisenc64.dll", -#elif defined(WIN32) +#if defined(WIN32) "libvorbisenc.dll", "vorbisenc.dll", #elif defined(MACOSX) @@ -566,9 +560,7 @@ qboolean SCR_CaptureVideo_Ogg_OpenLibrary() }; const char* dllnames_th [] = { -#if defined(WIN64) - "libtheora64.dll", -#elif defined(WIN32) +#if defined(WIN32) "libtheora.dll", "theora.dll", #elif defined(MACOSX) @@ -590,7 +582,7 @@ qboolean SCR_CaptureVideo_Ogg_OpenLibrary() Sys_LoadLibrary (dllnames_ve, &ve_dll, vorbisencfuncs); } -void SCR_CaptureVideo_Ogg_Init() +void SCR_CaptureVideo_Ogg_Init(void) { SCR_CaptureVideo_Ogg_OpenLibrary(); @@ -604,12 +596,12 @@ void SCR_CaptureVideo_Ogg_Init() Cvar_RegisterVariable(&cl_capturevideo_ogg_vorbis_quality); } -qboolean SCR_CaptureVideo_Ogg_Available() +qboolean SCR_CaptureVideo_Ogg_Available(void) { return og_dll && th_dll && vo_dll && ve_dll; } -void SCR_CaptureVideo_Ogg_CloseDLL() +void SCR_CaptureVideo_Ogg_CloseDLL(void) { Sys_UnloadLibrary (&ve_dll); Sys_UnloadLibrary (&vo_dll); @@ -650,7 +642,7 @@ typedef struct capturevideostate_ogg_formatspecific_s capturevideostate_ogg_formatspecific_t; #define LOAD_FORMATSPECIFIC_OGG() capturevideostate_ogg_formatspecific_t *format = (capturevideostate_ogg_formatspecific_t *) cls.capturevideo.formatspecific -static void SCR_CaptureVideo_Ogg_Interleave() +static void SCR_CaptureVideo_Ogg_Interleave(void) { LOAD_FORMATSPECIFIC_OGG(); ogg_page pg; @@ -708,7 +700,7 @@ static void SCR_CaptureVideo_Ogg_Interleave() } } -static void SCR_CaptureVideo_Ogg_FlushInterleaving() +static void SCR_CaptureVideo_Ogg_FlushInterleaving(void) { LOAD_FORMATSPECIFIC_OGG(); @@ -726,7 +718,7 @@ static void SCR_CaptureVideo_Ogg_FlushInterleaving() } } -static void SCR_CaptureVideo_Ogg_EndVideo() +static void SCR_CaptureVideo_Ogg_EndVideo(void) { LOAD_FORMATSPECIFIC_OGG(); ogg_page pg; @@ -819,7 +811,7 @@ static void SCR_CaptureVideo_Ogg_EndVideo() cls.capturevideo.videofile = NULL; } -static void SCR_CaptureVideo_Ogg_ConvertFrame_BGRA_to_YUV() +static void SCR_CaptureVideo_Ogg_ConvertFrame_BGRA_to_YUV(void) { LOAD_FORMATSPECIFIC_OGG(); yuv_buffer *yuv; @@ -932,7 +924,7 @@ static void SCR_CaptureVideo_Ogg_SoundFrame(const portable_sampleframe_t *paintb SCR_CaptureVideo_Ogg_Interleave(); } -void SCR_CaptureVideo_Ogg_BeginVideo() +void SCR_CaptureVideo_Ogg_BeginVideo(void) { cls.capturevideo.format = CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA; cls.capturevideo.formatextension = "ogv"; @@ -987,7 +979,7 @@ void SCR_CaptureVideo_Ogg_BeginVideo() } format->yuvi = -1; // -1: no frame valid yet, write into 0 - FindFraction(cls.capturevideo.framerate, &num, &denom, 1001); + FindFraction(cls.capturevideo.framerate / cls.capturevideo.framestep, &num, &denom, 1001); ti.fps_numerator = num; ti.fps_denominator = denom; @@ -1009,13 +1001,13 @@ void SCR_CaptureVideo_Ogg_BeginVideo() if(ti.quality < 0) { ti.target_bitrate = -1; - ti.keyframe_data_target_bitrate = -1; + ti.keyframe_data_target_bitrate = (unsigned int)-1; ti.quality = 63; } else { ti.target_bitrate = -1; - ti.keyframe_data_target_bitrate = -1; + ti.keyframe_data_target_bitrate = (unsigned int)-1; ti.quality = bound(0, ti.quality, 63); } }