diff options
author | jstebbins <[email protected]> | 2014-08-11 17:48:19 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-08-11 17:48:19 +0000 |
commit | bd9ba67e17b996d59354c280604c7e8b045d437b (patch) | |
tree | a14ca122c75190540f25b7889f671cbd5b671423 /gtk/src | |
parent | 9f932fe0d2d9d2255e1dfd80b3c542901f260142 (diff) |
LinGui: Fix initialization of audio quality widget limits
When opening the audio edit dialog for a track in the audio list,
the audio quality was set to a bad value because the limits were
not set correctly.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6291 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/audiohandler.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index 2f7c93aea..38d4c3b11 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -438,7 +438,7 @@ audio_update_dialog_widgets(signal_user_data_t *ud, GValue *asettings) ghb_ui_update(ud, "AudioTrackQuality", ghb_settings_get_value(asettings, "AudioTrackQuality")); - quality = ghb_settings_get_double(asettings, "AudioTrackQualitySlider"); + quality = ghb_settings_get_double(asettings, "AudioTrackQuality"); s_quality = get_quality_string(asettings, quality); ghb_ui_update(ud, "AudioTrackQualityValue", ghb_string_value(s_quality)); ghb_ui_update(ud, "AudioTrackQualityEnable", @@ -1012,6 +1012,21 @@ audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_widget_to_setting(ud->settings, widget); acodec = ghb_settings_audio_encoder_codec(ud->settings, "AudioEncoder"); + float low, high, gran, defval; + int dir; + hb_audio_quality_get_limits(acodec, &low, &high, &gran, &dir); + defval = hb_audio_quality_get_default(acodec); + GtkScaleButton *sb; + GtkAdjustment *adj; + sb = GTK_SCALE_BUTTON(GHB_WIDGET(ud->builder, "AudioTrackQuality")); + adj = gtk_scale_button_get_adjustment(sb); + if (dir) + { + // Quality values are inverted + defval = high - defval + low; + } + gtk_adjustment_configure (adj, defval, low, high, gran, gran * 10, 0); + if (block_updates) { prev_acodec = acodec; @@ -1077,21 +1092,6 @@ audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_audio_list_refresh_selected(ud); ghb_live_reset(ud); } - - float low, high, gran, defval; - int dir; - hb_audio_quality_get_limits(acodec, &low, &high, &gran, &dir); - defval = hb_audio_quality_get_default(acodec); - GtkScaleButton *sb; - GtkAdjustment *adj; - sb = GTK_SCALE_BUTTON(GHB_WIDGET(ud->builder, "AudioTrackQuality")); - adj = gtk_scale_button_get_adjustment(sb); - if (dir) - { - // Quality values are inverted - defval = high - defval + low; - } - gtk_adjustment_configure (adj, defval, low, high, gran, gran * 10, 0); } G_MODULE_EXPORT void @@ -1230,8 +1230,6 @@ quality_widget_changed_cb(GtkWidget *widget, gdouble quality, signal_user_data_t { GValue *asettings; - g_debug("quality_widget_changed_cb ()"); - ghb_check_dependency(ud, widget, NULL); char *s_quality = get_quality_string(ud->settings, quality); ghb_ui_update( ud, "AudioTrackQualityValue", ghb_string_value(s_quality)); |