]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
support formatoptions
authorRudolf Polzer <divverent@alientrap.org>
Sun, 13 Feb 2011 17:26:29 +0000 (18:26 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 13 Feb 2011 17:26:29 +0000 (18:26 +0100)
cap_lavc.c

index b5e4a30672d0901a9b54b413a968f1f27db3c854..e09b143126c109be49f73fda831f3d5cbc9621e4 100644 (file)
@@ -485,6 +485,7 @@ qboolean SCR_CaptureVideo_Lavc_Available(void)
 
 #if DEFAULT_VP8
 static cvar_t cl_capturevideo_lavc_format = {CVAR_SAVE, "cl_capturevideo_lavc_format", "mkv", "video format to use"};
+static cvar_t cl_capturevideo_lavc_formatoptions = {CVAR_SAVE, "cl_capturevideo_lavc_formatoptions", "", "space separated key=value pairs for video format flags"};
 static cvar_t cl_capturevideo_lavc_vcodec = {CVAR_SAVE, "cl_capturevideo_lavc_vcodec", "libvpx", "video codec to use"};
 static cvar_t cl_capturevideo_lavc_voptions = {CVAR_SAVE, "cl_capturevideo_lavc_voptions", "", "space separated key=value pairs for video encoder flags"};
 static cvar_t cl_capturevideo_lavc_acodec = {CVAR_SAVE, "cl_capturevideo_lavc_acodec", "vorbis", "audio codec to use"};
@@ -514,6 +515,7 @@ void SCR_CaptureVideo_Lavc_Init(void)
                qavcodec_register_all();
                qav_register_all();
                Cvar_RegisterVariable(&cl_capturevideo_lavc_format);
+               Cvar_RegisterVariable(&cl_capturevideo_lavc_formatoptions);
                Cvar_RegisterVariable(&cl_capturevideo_lavc_vcodec);
                Cvar_RegisterVariable(&cl_capturevideo_lavc_voptions);
                Cvar_RegisterVariable(&cl_capturevideo_lavc_acodec);
@@ -781,6 +783,10 @@ void SCR_CaptureVideo_Lavc_BeginVideo(void)
                        return;
                }
                strlcpy(format->avf->filename, fn, sizeof(format->avf->filename));
+               if(qav_set_options_string(video_str->codec, cl_capturevideo_lavc_formatoptions.string, "=", " \t") < 0)
+               {
+                       Con_Printf("Failed to set format options\n");
+               }
 
                video_str = qav_new_stream(format->avf, 0);
                video_str->codec->codec_type = AVMEDIA_TYPE_VIDEO;