summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2018-08-08 15:10:10 -0700
committerJohn Stebbins <[email protected]>2018-08-09 14:45:15 -0700
commit4002693aca04d7d0130516b1e29c77e2535be635 (patch)
tree8e688cac744ed6f91e1e2e1e04fb3ef67c3ccef3 /gtk
parent85c00c7a26ab05876c98b04b317dafd679135081 (diff)
LinGui: handle missing default preset better
Search for original default official preset. If still missing, select first available preset. Addresses problem seen in: https://github.com/HandBrake/HandBrake/pull/1524 (cherry picked from commit 42972a019972147c239f0f8b1a06ffa05c28e737)
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/presets.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index b2ef25089..361a4a70e 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -634,6 +634,20 @@ ghb_select_default_preset(signal_user_data_t *ud)
hb_preset_index_t *path;
path = hb_presets_get_default_index();
+ if (path == NULL || path->depth == 0)
+ {
+ // No default set, find original "default" preset
+ g_free(path);
+ path = hb_preset_search_index("Fast 1080p30", 1, HB_PRESET_TYPE_ALL);
+ }
+ if (path == NULL || path->depth == 0)
+ {
+ int index[2] = {0, 0};
+
+ // Could not find original default, try first available preset
+ g_free(path);
+ path = hb_preset_index_init(index, 2);
+ }
if (path != NULL)
{
select_preset2(ud, path);