diff options
author | jstebbins <[email protected]> | 2009-06-11 18:49:59 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-06-11 18:49:59 +0000 |
commit | 025ec4178852643d51df2003d23a21bd74206a26 (patch) | |
tree | 0eb82483d25354c0a52ca7de346e4d28624e7e00 /gtk/src/x264handler.c | |
parent | 942cd1e98536e86ba7d6e70d5fee41e5b4419bd3 (diff) |
LinGui: per irc discussion with D_S, in turbo 1st pass, leave weightb alone
if b-adapt=2.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2520 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/x264handler.c')
-rw-r--r-- | gtk/src/x264handler.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/gtk/src/x264handler.c b/gtk/src/x264handler.c index ff2338f19..17c67db36 100644 --- a/gtk/src/x264handler.c +++ b/gtk/src/x264handler.c @@ -651,6 +651,56 @@ x264_remove_opt(gchar **opts, gchar **opt_syns) } } +static gchar* +x264_lookup_value(gchar **opts, gchar **opt_syns) +{ + gchar *ret = NULL; + gint pos; + + const gchar *def_val = x264_opt_get_default(opt_syns[0]); + + pos = x264_find_opt(opts, opt_syns); + if (pos >= 0) + { + gchar *cpos = strchr(opts[pos], '='); + if (cpos != NULL) + { + ret = g_strdup(cpos+1); + } + else + { + ret = g_strdup(""); + } + } + else if (def_val != NULL) + { + ret = g_strdup(def_val); + } + return ret; +} + +gint +ghb_lookup_badapt(gchar *options) +{ + gint ret = 0; + gchar *result; + gchar **split; + + if (options == NULL) + options = ""; + + split = g_strsplit(options, ":", -1); + + result = x264_lookup_value(split, x264_badapt_syns); + g_strfreev(split); + if (result != NULL) + { + ret = g_strtod(result, NULL); + g_free(result); + } + return ret; +} + // Construct the x264 options string // The result is allocated, so someone must free it at some point. static gchar* |