From 3c19c509af38424cd04df53e1af7ef1b20a191ef Mon Sep 17 00:00:00 2001 From: Matthew Wozniak Date: Mon, 4 Nov 2024 11:11:57 -0500 Subject: allow the user to change the quality vs speed setting --- render.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index 495a918..4b633a4 100644 --- a/render.c +++ b/render.c @@ -101,7 +101,7 @@ void VIRTUAL hook_stop_playback(struct demoplayer *this) { } bool render_init(int width, int height, int framerate, bool use_bitrate, - int quality, const char *output_file) { + int quality, const char *output_file, int qvs) { bool r = os_mprot((*videomode)->vt, 28 * sizeof(void *), PAGE_EXECUTE_READWRITE); if (!r) bail("couldn't mprotect videomode vtable"); @@ -178,9 +178,8 @@ bool render_init(int width, int height, int framerate, bool use_bitrate, VARIANT _quality = { .vt = VT_UI4, .ulVal = quality }; HR(codec->lpVtbl->SetValue(codec, &CODECAPI_AVEncCommonQuality, &_quality)); - // even at 100 it is still very quick, really no reason to change it - VARIANT qvs = { .vt = VT_UI4, .ulVal = 100 }; - HR(codec->lpVtbl->SetValue(codec, &CODECAPI_AVEncCommonQualityVsSpeed, &qvs)); + VARIANT _qvs = { .vt = VT_UI4, .ulVal = qvs }; + HR(codec->lpVtbl->SetValue(codec, &CODECAPI_AVEncCommonQualityVsSpeed, &_qvs)); // set the gop size to 2 seconds VARIANT gop = { .vt = VT_UI4, .ulVal = 2 * ctx.fps }; -- cgit v1.2.3-54-g00ecf