summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/callbacks.c14
-rw-r--r--libhb/hb.c37
2 files changed, 7 insertions, 44 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 215900275..e77e90de4 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -1873,7 +1873,7 @@ set_title_settings(signal_user_data_t *ud, GhbValue *settings)
if (!(keep_aspect || pic_par) || pic_par == 3)
{
ghb_dict_set_int(settings, "scale_height",
- title->geometry.width - title->crop[0] - title->crop[1]);
+ title->geometry.height - title->crop[0] - title->crop[1]);
}
ghb_set_scale_settings(settings, GHB_PIC_KEEP_PAR|GHB_PIC_USE_MAX);
@@ -2501,7 +2501,7 @@ scale_width_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale(ud, GHB_PIC_KEEP_WIDTH);
+ ghb_set_scale(ud, GHB_PIC_KEEP_WIDTH|GHB_PIC_KEEP_PAR);
update_preview = TRUE;
ghb_live_reset(ud);
@@ -2516,7 +2516,7 @@ scale_height_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale(ud, GHB_PIC_KEEP_HEIGHT);
+ ghb_set_scale(ud, GHB_PIC_KEEP_HEIGHT|GHB_PIC_KEEP_PAR);
update_preview = TRUE;
ghb_live_reset(ud);
@@ -2532,7 +2532,7 @@ crop_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale(ud, 0);
+ ghb_set_scale(ud, GHB_PIC_KEEP_PAR);
update_preview = TRUE;
ghb_live_reset(ud);
@@ -2562,7 +2562,7 @@ display_height_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale(ud, GHB_PIC_KEEP_DISPLAY_HEIGHT);
+ ghb_set_scale(ud, GHB_PIC_KEEP_DISPLAY_HEIGHT|GHB_PIC_KEEP_PAR);
update_preview = TRUE;
}
@@ -2590,7 +2590,7 @@ scale_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale(ud, 0);
+ ghb_set_scale(ud, GHB_PIC_KEEP_PAR);
update_preview = TRUE;
update_aspect_info(ud);
@@ -2604,7 +2604,7 @@ show_crop_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_check_dependency(ud, widget, NULL);
ghb_live_reset(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale(ud, 0);
+ ghb_set_scale(ud, GHB_PIC_KEEP_PAR);
ghb_pref_save(ud->prefs, "preview_show_crop");
update_preview = TRUE;
}
diff --git a/libhb/hb.c b/libhb/hb.c
index 5f688c012..c5c3c8cf1 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -1155,9 +1155,6 @@ void hb_set_anamorphic_size2(hb_geometry_t *src_geo,
/* Anamorphic 3: Power User Jamboree
- Set everything based on specified values */
- /* Use specified storage dimensions */
- storage_aspect = (double)geo->geometry.width / geo->geometry.height;
-
/* Time to get picture dimensions that divide cleanly.*/
width = MULTIPLE_MOD_UP(geo->geometry.width, mod);
height = MULTIPLE_MOD_UP(geo->geometry.height, mod);
@@ -1166,31 +1163,10 @@ void hb_set_anamorphic_size2(hb_geometry_t *src_geo,
if (maxWidth && width > maxWidth)
{
width = maxWidth;
- // If we are keeping the display aspect, then we are going
- // to be modifying the PAR anyway. So it's preferred
- // to let the width/height stray some from the original
- // requested storage aspect.
- //
- // But otherwise, PAR and DAR will change the least
- // if we stay as close as possible to the requested
- // storage aspect.
- if (!keep_display_aspect &&
- (maxHeight == 0 || height < maxHeight))
- {
- height = width / storage_aspect + 0.5;
- height = MULTIPLE_MOD(height, mod);
- }
}
if (maxHeight && height > maxHeight)
{
height = maxHeight;
- // Ditto, see comment above
- if (!keep_display_aspect &&
- (maxWidth == 0 || width < maxWidth))
- {
- width = height * storage_aspect + 0.5;
- width = MULTIPLE_MOD(width, mod);
- }
}
if (keep_display_aspect)
{
@@ -1203,19 +1179,6 @@ void hb_set_anamorphic_size2(hb_geometry_t *src_geo,
dst_par_den = (int64_t)width * cropped_height *
src_par.den;
}
- else
- {
- /* If the dimensions were changed by the modulus
- * or by maxWidth/maxHeight, we also change the
- * output PAR so that the DAR is unchanged.
- *
- * PAR is the requested output display width / storage width
- * requested output display width is the original
- * requested width * original requested PAR
- */
- dst_par_num = geo->geometry.width * dst_par_num;
- dst_par_den = width * dst_par_den;
- }
} break;
}