diff options
author | jstebbins <[email protected]> | 2015-02-16 16:24:17 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-02-16 16:24:17 +0000 |
commit | fd2efdba537c5794caef0cd82fc6c60e4f319f74 (patch) | |
tree | 872171a595fac90992a72e213c444e1838b406d3 /gtk/src | |
parent | 1e28500ecfe811792ae47f477b4edbab19afa48d (diff) |
LinGui: make fallback audio encoder selection use libhb function
This way I don't have up update this every time new codecs are added.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6912 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/audiohandler.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index 2af63fb67..9f739bceb 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -177,30 +177,23 @@ int ghb_select_fallback(GValue *settings, int acodec) { gint fallback = 0; - switch ( acodec ) + if (acodec & HB_ACODEC_PASS_FLAG) { - case HB_ACODEC_MP3_PASS: - return HB_ACODEC_LAME; - - case HB_ACODEC_AAC_PASS: - return HB_ACODEC_FFAAC; - - case HB_ACODEC_AC3_PASS: - return HB_ACODEC_AC3; - - default: + fallback = hb_audio_encoder_get_fallback_for_passthru(acodec); + if (fallback != 0) { - const char *mux_id; - const hb_container_t *mux; - - mux_id = ghb_settings_get_const_string(settings, "FileFormat"); - mux = ghb_lookup_container_by_name(mux_id); - - fallback = ghb_settings_audio_encoder_codec(settings, - "AudioEncoderFallback"); - return hb_autopassthru_get_encoder(acodec, 0, fallback, mux->format); + return fallback; } } + const char *mux_id; + const hb_container_t *mux; + + mux_id = ghb_settings_get_const_string(settings, "FileFormat"); + mux = ghb_lookup_container_by_name(mux_id); + + fallback = ghb_settings_audio_encoder_codec(settings, + "AudioEncoderFallback"); + return hb_autopassthru_get_encoder(acodec, 0, fallback, mux->format); } void |