Skip to content

Commit

Permalink
Make AV1 off by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Oct 8, 2023
1 parent 003aa51 commit 7d736e8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/app/app_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ void settings_initialize(app_settings_t *config, char *conf_dir) {
config->absmouse = true;
config->virtual_mouse = false;
config->hdr = false;
config->av1 = true;
config->hevc = true;
config->av1 = false;

config->conf_dir = conf_dir;
config->ini_path = path_join(conf_dir, CONF_NAME_MOONLIGHT);
Expand Down
26 changes: 14 additions & 12 deletions src/app/ui/settings/panes/video.pane.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,7 @@ static lv_obj_t *create_obj(lv_fragment_t *self, lv_obj_t *container) {

pref_header(view, "Video Settings");

lv_obj_t *av1_checkbox = pref_checkbox(view, locstr("Use AV1 if possible"), &app_configuration->av1, false);
lv_obj_t *av1_hint = pref_desc_label(view, NULL, false);
if (app->ss4s.video_cap.codecs & SS4S_VIDEO_AV1) {
lv_obj_clear_state(av1_checkbox, LV_STATE_DISABLED);
lv_label_set_text(av1_hint, locstr("AV1 usually has better graphics, and supports HDR."));
} else {
lv_obj_add_state(av1_checkbox, LV_STATE_DISABLED);
lv_label_set_text_fmt(av1_hint, locstr("%s decoder doesn't support AV1 codec."),
SS4S_ModuleInfoGetName(app->ss4s.selection.video_module));
}

lv_obj_t *hevc_checkbox = pref_checkbox(view, locstr("Use H265 if possible"), &app_configuration->hevc, false);
lv_obj_t *hevc_checkbox = pref_checkbox(view, locstr("Use H265 when possible"), &app_configuration->hevc, false);
lv_obj_t *hevc_hint = pref_desc_label(view, NULL, false);
if (app->ss4s.video_cap.codecs & SS4S_VIDEO_H265) {
lv_obj_clear_state(hevc_checkbox, LV_STATE_DISABLED);
Expand All @@ -108,6 +97,19 @@ static lv_obj_t *create_obj(lv_fragment_t *self, lv_obj_t *container) {
SS4S_ModuleInfoGetName(app->ss4s.selection.video_module));
}

lv_obj_t *av1_checkbox = pref_checkbox(view, locstr("Use AV1 when possible (Experimental)"),
&app_configuration->av1, false);
lv_obj_t *av1_hint = pref_desc_label(view, NULL, false);
if (app->ss4s.video_cap.codecs & SS4S_VIDEO_AV1) {
lv_obj_clear_state(av1_checkbox, LV_STATE_DISABLED);
lv_label_set_text(av1_hint, locstr("AV1 usually has better graphics, and supports HDR. "
"However, it might be much slower than H265 or H264."));
} else {
lv_obj_add_state(av1_checkbox, LV_STATE_DISABLED);
lv_label_set_text_fmt(av1_hint, locstr("%s decoder doesn't support AV1 codec."),
SS4S_ModuleInfoGetName(app->ss4s.selection.video_module));
}

lv_obj_t *hdr_checkbox = pref_checkbox(view, locstr("HDR"), &app_configuration->hdr, false);
lv_obj_t *hdr_hint = pref_desc_label(view, NULL, false);
controller->hdr_checkbox = hdr_checkbox;
Expand Down

0 comments on commit 7d736e8

Please sign in to comment.