diff options
-rw-r--r-- | gtk/src/audiohandler.c | 3 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 28 | ||||
-rw-r--r-- | gtk/src/hb-backend.h | 2 |
3 files changed, 22 insertions, 11 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index de56340e5..330078647 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -96,7 +96,8 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud) } else { - select_acodec = ghb_select_audio_codec(ud->settings, aconfig, acodec); + gint mux = ghb_settings_get_int(ud->settings, "FileFormat"); + select_acodec = ghb_select_audio_codec(mux, aconfig, acodec); if (acodec != HB_ACODEC_ANY) { ghb_ui_update(ud, "AudioEncoder", ghb_int64_value(select_acodec)); diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index df909c1b9..5f706733b 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -1537,7 +1537,7 @@ void ghb_grey_combo_options(GtkBuilder *builder) { GtkWidget *widget; - gint container, track, titleindex, acodec; + gint mux, track, titleindex, acodec; hb_audio_config_t *aconfig = NULL; GValue *gval; @@ -1552,7 +1552,7 @@ ghb_grey_combo_options(GtkBuilder *builder) aconfig = get_hb_audio(h_scan, titleindex, track); widget = GHB_WIDGET (builder, "FileFormat"); gval = ghb_widget_value(widget); - container = ghb_lookup_combo_int("FileFormat", gval); + mux = ghb_lookup_combo_int("FileFormat", gval); ghb_value_free(gval); grey_combo_box_item(builder, "x264_analyse", 4, TRUE); @@ -1562,13 +1562,19 @@ ghb_grey_combo_options(GtkBuilder *builder) grey_combo_box_item(builder, "AudioEncoder", HB_ACODEC_VORBIS, FALSE); gboolean allow_dca = TRUE; - allow_dca = (container != HB_MUX_MP4); + allow_dca = (mux != HB_MUX_MP4); grey_combo_box_item(builder, "AudioEncoder", HB_ACODEC_AC3_PASS, FALSE); if (allow_dca) + { grey_combo_box_item(builder, "AudioEncoder", HB_ACODEC_DCA_PASS, FALSE); + grey_combo_box_item(builder, "AudioEncoder", HB_ACODEC_DCA_HD_PASS, FALSE); + } else + { grey_combo_box_item(builder, "AudioEncoder", HB_ACODEC_DCA_PASS, TRUE); + grey_combo_box_item(builder, "AudioEncoder", HB_ACODEC_DCA_HD_PASS, TRUE); + } if (aconfig && aconfig->in.codec != HB_ACODEC_AC3) { @@ -1578,6 +1584,10 @@ ghb_grey_combo_options(GtkBuilder *builder) { grey_combo_box_item(builder, "AudioEncoder", HB_ACODEC_DCA_PASS, TRUE); } + if (aconfig && aconfig->in.codec != HB_ACODEC_DCA_HD) + { + grey_combo_box_item(builder, "AudioEncoder", HB_ACODEC_DCA_HD_PASS, TRUE); + } grey_combo_box_item(builder, "VideoEncoder", HB_VCODEC_THEORA, FALSE); widget = GHB_WIDGET (builder, "AudioEncoder"); @@ -1585,7 +1595,7 @@ ghb_grey_combo_options(GtkBuilder *builder) acodec = ghb_lookup_combo_int("AudioEncoder", gval); ghb_value_free(gval); grey_combo_box_item(builder, "AudioMixdown", 0, TRUE); - if (container == HB_MUX_MP4) + if (mux == HB_MUX_MP4) { grey_combo_box_item(builder, "AudioEncoder", HB_ACODEC_VORBIS, TRUE); grey_combo_box_item(builder, "VideoEncoder", HB_VCODEC_THEORA, TRUE); @@ -1596,16 +1606,17 @@ ghb_grey_combo_options(GtkBuilder *builder) gboolean allow_dolby = TRUE; gboolean allow_dpl2 = TRUE; gboolean allow_6ch = TRUE; - allow_mono = TRUE; allow_6ch = acodec & ~HB_ACODEC_LAME; if (aconfig) { + acodec = ghb_select_audio_codec(mux, aconfig, acodec); gint best = hb_get_best_mixdown(acodec, aconfig->in.channel_layout, 0); allow_stereo = best >= HB_AMIXDOWN_STEREO; allow_dolby = best >= HB_AMIXDOWN_DOLBY; allow_dpl2 = best >= HB_AMIXDOWN_DOLBYPLII; allow_6ch = best >= HB_AMIXDOWN_6CH; + allow_mono = best >= HB_AMIXDOWN_MONO; } grey_combo_box_item(builder, "AudioMixdown", HB_AMIXDOWN_MONO, !allow_mono); grey_combo_box_item(builder, "AudioMixdown", HB_AMIXDOWN_STEREO, !allow_stereo); @@ -4124,10 +4135,8 @@ ghb_validate_subtitles(signal_user_data_t *ud) } gint -ghb_select_audio_codec(GValue *settings, hb_audio_config_t *aconfig, gint acodec) +ghb_select_audio_codec(gint mux, hb_audio_config_t *aconfig, gint acodec) { - gint mux = ghb_settings_combo_int(settings, "FileFormat"); - guint32 in_codec = aconfig ? aconfig->in.codec : HB_ACODEC_MASK; if (mux == HB_MUX_MP4) { @@ -4724,7 +4733,8 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) title->list_audio, audio.in.track ); acodec = ghb_settings_combo_int(asettings, "AudioEncoder"); - audio.out.codec = ghb_select_audio_codec(js, aconfig, acodec); + + audio.out.codec = ghb_select_audio_codec(job->mux, aconfig, acodec); audio.out.gain = ghb_settings_get_double(asettings, "AudioTrackGain"); diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h index 3056422aa..6733ad306 100644 --- a/gtk/src/hb-backend.h +++ b/gtk/src/hb-backend.h @@ -175,7 +175,7 @@ gdouble ghb_lookup_combo_double(const gchar *name, const GValue *gval); const gchar* ghb_lookup_combo_option(const gchar *name, const GValue *gval); const gchar* ghb_lookup_combo_string(const gchar *name, const GValue *gval); gchar* ghb_get_tmp_dir(); -gint ghb_select_audio_codec(GValue *settings, hb_audio_config_t *aconfig, gint acodec); +gint ghb_select_audio_codec(gint mux, hb_audio_config_t *aconfig, gint acodec); gint ghb_find_closest_audio_rate(gint rate); GValue* ghb_lookup_acodec_value(gint val); |