diff options
author | jstebbins <[email protected]> | 2008-10-18 23:48:53 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2008-10-18 23:48:53 +0000 |
commit | 3c199946f7eb66a581454aa60392dba8cc174d7e (patch) | |
tree | 08e02e136d9efa1c174292497efb84e3824f92fc /gtk/src/presets.c | |
parent | 152ec1f0a7350d70e87a0a265f806b5400ce4ae0 (diff) |
LinGui: add pref option to scale down high def previews
when this option is enabled, if the preview dims are above a threshold
then the size is scaled down to no larger than 1280x720.
1080p previews are too big for my laptop :-P
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1846 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/presets.c')
-rw-r--r-- | gtk/src/presets.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk/src/presets.c b/gtk/src/presets.c index bb5e2e70f..cfea98699 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -1723,6 +1723,7 @@ export_subtitle_xlat2(GValue *lin_val) gchar *str; GValue *gval; + if (lin_val == NULL) return NULL; str = ghb_value_string(lin_val); if (strcmp(str, "none") == 0) { @@ -1770,6 +1771,7 @@ import_subtitle_xlat2(GValue *mac_val) gchar *str; GValue *gval; + if (mac_val == NULL) return NULL; str = ghb_value_string(mac_val); if (strcmp(str, "None") == 0) { @@ -1793,6 +1795,7 @@ export_audio_track_xlat2(GValue *lin_val) gchar *str; GValue *gval = NULL; + if (lin_val == NULL) return NULL; str = ghb_value_string(lin_val); if (strcmp(str, "none") == 0) { @@ -1814,6 +1817,7 @@ import_audio_track_xlat2(GValue *mac_val) gchar *str; GValue *gval; + if (mac_val == NULL) return NULL; val = ghb_value_int(mac_val); if (val <= 0) { @@ -2323,6 +2327,25 @@ ghb_presets_reload(signal_user_data_t *ud) store_presets(); } +static gboolean +check_old_presets() +{ + gint count, ii; + + count = ghb_array_len(presetsPlist); + for (ii = count-1; ii >= 0; ii--) + { + GValue *dict; + GValue *type; + + dict = ghb_array_get_nth(presetsPlist, ii); + type = ghb_dict_lookup(dict, "Type"); + if (type == NULL) + return TRUE; + } + return FALSE; +} + void ghb_presets_load() { @@ -2338,6 +2361,12 @@ ghb_presets_load() presetsPlist = ghb_value_dup(ghb_resource_get("standard-presets")); store_presets(); } + else if (check_old_presets()) + { + ghb_value_free(presetsPlist); + presetsPlist = ghb_value_dup(ghb_resource_get("standard-presets")); + store_presets(); + } import_xlat_presets(presetsPlist); } |