MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / vquality_changed_cb

Function vquality_changed_cb

gtk/src/callbacks.c:3294–3344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3292}
3293
3294G_MODULE_EXPORT void
3295vquality_changed_cb (GtkWidget *widget, gpointer data)
3296{
3297 signal_user_data_t *ud = ghb_ud();
3298
3299 ghb_widget_to_setting(ud->settings, widget);
3300 ghb_clear_presets_selection(ud);
3301 ghb_live_reset(ud);
3302
3303 gint vcodec;
3304 double vquality;
3305
3306 vcodec = ghb_settings_video_encoder_codec(ud->settings, "VideoEncoder");
3307 vquality = ghb_dict_get_double(ud->settings, "VideoQualitySlider");
3308 if (vcodec == HB_VCODEC_X264_8BIT && vquality < 1.0)
3309 {
3310 // Set Profile to auto for lossless x264
3311 ghb_ui_update("VideoProfile", ghb_string_value("auto"));
3312 }
3313
3314 gdouble step;
3315 float min, max, min_step;
3316 int direction;
3317
3318 hb_video_quality_get_limits(vcodec, &min, &max, &min_step, &direction);
3319 step = ghb_settings_combo_double(ud->prefs, "VideoQualityGranularity");
3320 if (step < min_step)
3321 {
3322 step = min_step;
3323 }
3324 gdouble val = gtk_range_get_value(GTK_RANGE(widget));
3325 if (val < 0)
3326 {
3327 val = ((int)((val - step / 2) / step)) * step;
3328 }
3329 else
3330 {
3331 val = ((int)((val + step / 2) / step)) * step;
3332 }
3333 if (val < min)
3334 {
3335 val = min;
3336 }
3337 if (val > max)
3338 {
3339 val = max;
3340 }
3341 gtk_range_set_value(GTK_RANGE(widget), val);
3342 if (ghb_check_name_template(ud, "{quality}"))
3343 ghb_set_destination(ud);
3344}
3345
3346static void
3347set_has_chapter_markers (gboolean markers, signal_user_data_t *ud)

Callers

nothing calls this directly

Calls 12

ghb_udFunction · 0.85
ghb_widget_to_settingFunction · 0.85
ghb_live_resetFunction · 0.85
ghb_dict_get_doubleFunction · 0.85
ghb_ui_updateFunction · 0.85
ghb_string_valueFunction · 0.85
ghb_check_name_templateFunction · 0.85
ghb_set_destinationFunction · 0.85

Tested by

no test coverage detected