summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/callbacks.c2
-rw-r--r--gtk/src/hb-backend.c57
-rw-r--r--gtk/src/makedeps.c4
-rw-r--r--gtk/src/resource_data.h4
-rw-r--r--gtk/src/resources.plist4
-rw-r--r--gtk/src/widget_reverse_deps4
6 files changed, 32 insertions, 43 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 6d745ed41..03160323a 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -88,6 +88,8 @@ dep_check(signal_user_data_t *ud, const gchar *name)
widget = GHB_WIDGET(ud->builder, widget_name);
dep_object = gtk_builder_get_object(ud->builder, name);
g_free(widget_name);
+ if (!GTK_WIDGET_SENSITIVE(widget))
+ continue;
if (dep_object == NULL)
{
g_message("Failed to find widget");
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index ebea3e73f..bff397401 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -2475,7 +2475,7 @@ ghb_set_scale(signal_user_data_t *ud, gint mode)
keep_width = FALSE;
keep_height = FALSE;
}
- if (anamorphic || keep_aspect)
+ if (keep_aspect)
{
keep_height = FALSE;
}
@@ -2564,17 +2564,12 @@ ghb_set_scale(signal_user_data_t *ud, gint mode)
if (anamorphic)
{
- if (round_dims)
- {
- job->modulus = 0;
- }
- else
- {
- // The scaler crashes if the dimensions are not divisible by 2
- // Align mod 2. And so does something in x264_encoder_headers()
- job->modulus = 2;
- }
+ job->anamorphic.mode = autoscale ? 2 : 3;
+ // The scaler crashes if the dimensions are not divisible by 2
+ // Align mod 2. And so does something in x264_encoder_headers()
+ job->anamorphic.modulus = round_dims ? 16 : 2;
job->width = width;
+ job->height = height;
if (max_height)
job->maxHeight = max_height;
job->crop[0] = crop[0]; job->crop[1] = crop[1];
@@ -2584,6 +2579,7 @@ ghb_set_scale(signal_user_data_t *ud, gint mode)
}
else
{
+ job->anamorphic.mode = 0;
if (keep_aspect)
{
gdouble par;
@@ -2643,23 +2639,19 @@ set_preview_job_settings(hb_job_t *job, GValue *settings)
job->crop[2] = ghb_settings_get_int(settings, "PictureLeftCrop");
job->crop[3] = ghb_settings_get_int(settings, "PictureRightCrop");
- gboolean anamorphic, round_dimensions;
+ gboolean anamorphic, round_dimensions, autoscale;
+ autoscale = ghb_settings_get_boolean(settings, "autoscale");
anamorphic = ghb_settings_get_boolean(settings, "anamorphic");
round_dimensions = ghb_settings_get_boolean(settings, "ModDimensions");
- if (round_dimensions && anamorphic)
- {
- job->modulus = 16;
- job->pixel_ratio = 2;
- }
- else if (anamorphic)
+ if (anamorphic)
{
- job->modulus = 2;
- job->pixel_ratio = 2;
+ job->anamorphic.modulus = round_dimensions ? 16 : 2;
+ job->anamorphic.mode = autoscale ? 2 : 3;
}
else
{
- job->modulus = 2;
- job->pixel_ratio = 0;
+ job->anamorphic.modulus = 2;
+ job->anamorphic.mode = 0;
}
job->width = ghb_settings_get_int(settings, "scale_width");
job->height = ghb_settings_get_int(settings, "scale_height");
@@ -3191,26 +3183,19 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
job->deinterlace = 0;
job->grayscale = ghb_settings_get_boolean(js, "VideoGrayScale");
+ gboolean autoscale = ghb_settings_get_boolean(js, "autoscale");
gboolean anamorphic = ghb_settings_get_boolean(js, "anamorphic");
gboolean round_dimensions = ghb_settings_get_boolean(js, "ModDimensions");
- if (round_dimensions && anamorphic)
- {
- job->pixel_ratio = 2;
- job->modulus = 16;
- }
- else if (anamorphic)
+ if (anamorphic)
{
- // Huh! I thought I wanted to use pixel_ratio 1 for this case, but
- // when its 1, libhb discards the width and height and uses original
- // title dims - crop. Thats not what I want.
- // Also, x264 requires things to divisible by 2.
- job->pixel_ratio = 2;
- job->modulus = 2;
+ job->anamorphic.mode = autoscale ? 2 : 3;
+ // Also, x264 requires things to be divisible by 2.
+ job->anamorphic.modulus = round_dimensions ? 16 : 2;
}
else
{
- job->pixel_ratio = 0;
- job->modulus = 2;
+ job->anamorphic.mode = 0;
+ job->anamorphic.modulus = 2;
}
/* Add selected filters */
job->filters = hb_list_init();
diff --git a/gtk/src/makedeps.c b/gtk/src/makedeps.c
index 308786f48..3aa6fcf6d 100644
--- a/gtk/src/makedeps.c
+++ b/gtk/src/makedeps.c
@@ -46,7 +46,9 @@ static dependency_t dep_map[] =
{"autoscale", "scale_width", "FALSE", FALSE},
{"autoscale", "scale_height", "FALSE", FALSE},
{"anamorphic", "PictureKeepRatio", "FALSE", FALSE},
- {"anamorphic", "scale_height", "FALSE", FALSE},
+ // "CHECK" is a dummy value that forces scale_height deps to
+ // be re-evaluated whenever anamorphic changes
+ {"anamorphic", "scale_height", "CHECK", TRUE},
{"PictureKeepRatio", "scale_height", "FALSE", FALSE},
{"VideoEncoder", "x264_tab", "x264", FALSE},
{"VideoEncoder", "x264_tab_label", "x264", FALSE},
diff --git a/gtk/src/resource_data.h b/gtk/src/resource_data.h
index 8187e931f..52d8a78b1 100644
--- a/gtk/src/resource_data.h
+++ b/gtk/src/resource_data.h
@@ -13023,8 +13023,8 @@
" </array>\n"
" <array>\n"
" <string>anamorphic</string>\n"
-" <string>FALSE</string>\n"
-" <false />\n"
+" <string>CHECK</string>\n"
+" <true />\n"
" </array>\n"
" <array>\n"
" <string>PictureKeepRatio</string>\n"
diff --git a/gtk/src/resources.plist b/gtk/src/resources.plist
index da361728b..a885d2640 100644
--- a/gtk/src/resources.plist
+++ b/gtk/src/resources.plist
@@ -7494,8 +7494,8 @@ R2RrUAAABBgBAQACAAAAQAAAABAAAAAQ////AP///wD///8A////AP///wD///8A////AP///wD///8A
</array>
<array>
<string>anamorphic</string>
- <string>FALSE</string>
- <false />
+ <string>CHECK</string>
+ <true />
</array>
<array>
<string>PictureKeepRatio</string>
diff --git a/gtk/src/widget_reverse_deps b/gtk/src/widget_reverse_deps
index 5128ffea1..0b1e3f4d9 100644
--- a/gtk/src/widget_reverse_deps
+++ b/gtk/src/widget_reverse_deps
@@ -261,8 +261,8 @@
</array>
<array>
<string>anamorphic</string>
- <string>FALSE</string>
- <false />
+ <string>CHECK</string>
+ <true />
</array>
<array>
<string>PictureKeepRatio</string>