}
}
ud->dont_clear_presets = TRUE;
+ ud->scale_busy = TRUE;
update_title_duration(ud);
widget = GHB_WIDGET (ud->builder, "source_dimensions");
text = g_strdup_printf ("%d x %d", tinfo->width, tinfo->height);
ghb_ui_update(ud, "PictureLeftCrop", ghb_int64_value(tinfo->crop[2]));
ghb_ui_update(ud, "PictureRightCrop", ghb_int64_value(tinfo->crop[3]));
}
+ ud->scale_busy = FALSE;
ghb_set_scale (ud, GHB_PIC_KEEP_PAR);
gint width, height, crop[4];
crop[0] = ghb_settings_get_int(ud->settings, "PictureTopCrop");
gint mod;
gint max_width = 0;
gint max_height = 0;
- static gboolean busy = FALSE;
g_debug("ghb_set_scale ()\n");
picture_settings_deps(ud);
gint titleindex;
titleindex = ghb_settings_combo_int(ud->settings, "title");
- title = hb_list_item( list, titleindex );
+ title = hb_list_item( list, titleindex );
if (title == NULL) return;
job = title->job;
if (job == NULL) return;
- if (busy) return;
- busy = TRUE;
+ if (ud->scale_busy) return;
+ ud->scale_busy = TRUE;
if (!ud->dont_clear_presets && (keep_width || keep_height))
{
width = MOD_ROUND(width, mod);
height = MOD_ROUND(height, mod);
- // Adjust dims according to max values
- if (max_height)
- height = MIN(height, max_height);
- if (max_width)
- width = MIN(width, max_width);
-
+ job->anamorphic.mode = pic_par;
if (pic_par)
{
- job->anamorphic.mode = pic_par;
// The scaler crashes if the dimensions are not divisible by 2
// Align mod 2. And so does something in x264_encoder_headers()
job->modulus = mod;
job->anamorphic.dar_height = 0;
if (keep_height && pic_par == 2)
- width = ((double)height * crop_width / crop_height) + mod / 2;
+ width = ((double)height * crop_width / crop_height);
job->width = width;
job->height = height;
job->maxWidth = max_width;
{
job->anamorphic.keep_display_aspect = 1;
}
+ // hb_set_anamorphic_size will adjust par, dar, and width/height
+ // to conform to job parameters that have been set, including
+ // maxWidth and maxHeight
hb_set_anamorphic_size( job, &width, &height,
&par_width, &par_height );
if (job->anamorphic.mode == 3 && !keep_aspect &&
}
else
{
- job->anamorphic.mode = pic_par;
+ // Adjust dims according to max values
+ if (max_height)
+ height = MIN(height, max_height);
+ if (max_width)
+ width = MIN(width, max_width);
+
if (keep_aspect)
{
gdouble par;
ghb_ui_update(ud, "PicturePARHeight", ghb_int64_value(par_height));
ghb_ui_update(ud, "PictureDisplayWidth", ghb_int64_value(disp_width));
ghb_ui_update(ud, "PictureDisplayHeight", ghb_int64_value(height));
- busy = FALSE;
+ ud->scale_busy = FALSE;
}
static void
if (!folder)
{
ud->dont_clear_presets = TRUE;
+ ud->scale_busy = TRUE;
// Temporarily set the video_quality range to (0,100)
// This is needed so the video_quality value does not get
// truncated when set. The range will be readjusted below
{
preset_update_title_deps(ud, &tinfo);
}
+ ud->scale_busy = FALSE;
ghb_set_scale (ud, GHB_PIC_KEEP_PAR);
ud->dont_clear_presets = FALSE;
if (!folder)
{
ud->dont_clear_presets = TRUE;
+ ud->scale_busy = TRUE;
// Temporarily set the video_quality range to (0,100)
// This is needed so the video_quality value does not get
// truncated when set. The range will be readjusted below
{
preset_update_title_deps(ud, &tinfo);
}
+ ud->scale_busy = FALSE;
ghb_set_scale (ud, GHB_PIC_KEEP_PAR);
ud->dont_clear_presets = FALSE;