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

Function audio_quality_radio_changed_cb

gtk/src/audiohandler.c:1125–1174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1123}
1124
1125G_MODULE_EXPORT void
1126audio_quality_radio_changed_cb (GtkWidget *widget, gpointer data)
1127{
1128 signal_user_data_t *ud = ghb_ud();
1129 ghb_widget_to_setting(ud->settings, widget);
1130
1131 GhbValue * asettings = audio_get_selected_settings(ud, NULL);
1132 if (asettings != NULL)
1133 {
1134 if (ghb_dict_get_bool(ud->settings, "AudioTrackQualityEnable"))
1135 {
1136 double quality = ghb_dict_get_double(asettings, "Quality");
1137 if (quality == HB_INVALID_AUDIO_QUALITY)
1138 {
1139 int acodec;
1140
1141 acodec = ghb_settings_audio_encoder_codec(asettings, "Encoder");
1142 quality = hb_audio_quality_get_default(acodec);
1143 ghb_dict_set_double(asettings, "Quality", quality);
1144 }
1145 ghb_dict_set_int(asettings, "Bitrate", -1);
1146 }
1147 else
1148 {
1149 int bitrate = ghb_dict_get_int(asettings, "Bitrate");
1150 if (bitrate <= 0)
1151 {
1152 const hb_title_t * title;
1153 hb_audio_config_t * aconfig;
1154 int track, acodec, sr, mix, title_id;
1155
1156 title_id = ghb_dict_get_int(ud->settings, "title");
1157 title = ghb_lookup_title(title_id, NULL);
1158 track = ghb_dict_get_int(asettings, "Track");
1159 acodec = ghb_settings_audio_encoder_codec(asettings, "Encoder");
1160 aconfig = ghb_get_audio_info(title, track);
1161 mix = ghb_settings_mixdown_mix(asettings, "Mixdown");
1162 sr = ghb_dict_get_int(asettings, "Samplerate");
1163 if (sr == 0 && aconfig != NULL)
1164 {
1165 sr = aconfig->in.samplerate;
1166 }
1167 bitrate = hb_audio_bitrate_get_default(acodec, sr, mix);
1168 ghb_dict_set_int(asettings, "Bitrate", bitrate);
1169 }
1170 ghb_dict_set_double(asettings, "Quality", HB_INVALID_AUDIO_QUALITY);
1171 }
1172 }
1173 audio_deps(ud, asettings, NULL);
1174}
1175
1176G_MODULE_EXPORT void
1177audio_passthru_widget_changed_cb (GtkWidget *widget, gpointer data)

Callers

nothing calls this directly

Calls 15

ghb_udFunction · 0.85
ghb_widget_to_settingFunction · 0.85
ghb_dict_get_boolFunction · 0.85
ghb_dict_get_doubleFunction · 0.85
ghb_dict_set_doubleFunction · 0.85
ghb_dict_set_intFunction · 0.85
ghb_dict_get_intFunction · 0.85
ghb_lookup_titleFunction · 0.85
ghb_get_audio_infoFunction · 0.85

Tested by

no test coverage detected