From 82777506b3f0a43e89e8863a456c1ae87f38c568 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 10 Feb 2024 07:22:02 +0100 Subject: Dont query supported video codecs twice --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 0291822..ed2167e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -165,6 +165,7 @@ struct SupportedVideoCodecs { }; static SupportedVideoCodecs supported_video_codecs; +static bool got_supported_video_codecs = false; struct Container { const char *container_name; @@ -2500,7 +2501,7 @@ static GtkWidget* create_common_settings_page(GtkStack *stack, GtkApplication *a gtk_grid_attach(video_codec_grid, gtk_label_new("Video codec: "), 0, 0, 1, 1); video_codec_input_menu = GTK_COMBO_BOX_TEXT(gtk_combo_box_text_new()); gtk_combo_box_text_append(video_codec_input_menu, "auto", "Auto (Recommended)"); - if(get_supported_video_codecs(&supported_video_codecs)) { + if(got_supported_video_codecs) { if(supported_video_codecs.h264) { gtk_combo_box_text_append(video_codec_input_menu, "h264", "H264"); } @@ -3365,7 +3366,7 @@ static void activate(GtkApplication *app, gpointer) { } } - get_supported_video_codecs(&supported_video_codecs); + got_supported_video_codecs = get_supported_video_codecs(&supported_video_codecs); std::string window_title = "GPU Screen Recorder | Running on "; window_title += gpu_vendor_to_name(gpu_inf.vendor); -- cgit v1.2.3