diff options
author | John Stebbins <[email protected]> | 2015-11-10 07:44:13 -0800 |
---|---|---|
committer | John Stebbins <[email protected]> | 2015-11-10 07:44:13 -0800 |
commit | 598a40fc53002a9f5adeba8fc45e4f7a42df2e25 (patch) | |
tree | f6f871a3b7d1dad4f444b95d7edebfd59f0b88fc /libhb/preset.c | |
parent | 638e83c3371eb0ac3490b9db90b6be865ccd9904 (diff) |
presets: handle importing old string PicturePAR "integers"
Diffstat (limited to 'libhb/preset.c')
-rw-r--r-- | libhb/preset.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libhb/preset.c b/libhb/preset.c index c4907fcbd..b2df84e3c 100644 --- a/libhb/preset.c +++ b/libhb/preset.c @@ -2100,6 +2100,43 @@ static void import_pic_0_0_0(hb_value_t *preset) } hb_dict_set(preset, "PicturePAR", hb_value_string(s)); } + else if (hb_value_type(val) == HB_VALUE_TYPE_STRING) + { + const char *v = hb_value_get_string(val); + const char *s; + char *end; + int pic_par = strtol(v, &end, 0); + if (end != NULL) + { + switch (pic_par) + { + default: + case 2: + s = "loose"; + break; + case 0: + s = "off"; + break; + case 1: + s = "strict"; + break; + case 3: + s = "custom"; + break; + } + hb_dict_set(preset, "PicturePAR", hb_value_string(s)); + } + else + { + if (strcasecmp(v, "off") && + strcasecmp(v, "strict") && + strcasecmp(v, "loose") && + strcasecmp(v, "custom")) + { + hb_dict_set(preset, "PicturePAR", hb_value_string("loose")); + } + } + } } static void import_audio_0_0_0(hb_value_t *preset) |