| 3292 | } |
| 3293 | |
| 3294 | G_MODULE_EXPORT void |
| 3295 | vquality_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 | |
| 3346 | static void |
| 3347 | set_has_chapter_markers (gboolean markers, signal_user_data_t *ud) |
nothing calls this directly
no test coverage detected