| 53 | } |
| 54 | |
| 55 | static void |
| 56 | ghb_sanitize_audio_settings(GhbValue *settings, GhbValue *asettings) |
| 57 | { |
| 58 | // Sanitize codec |
| 59 | const char * mux_name; |
| 60 | int title_id, mux, acodec, fallback, copy_mask, track; |
| 61 | uint32_t in_codec = 0; |
| 62 | hb_audio_config_t * aconfig; |
| 63 | const hb_title_t * title; |
| 64 | |
| 65 | title_id = ghb_dict_get_int(settings, "title"); |
| 66 | title = ghb_lookup_title(title_id, NULL); |
| 67 | |
| 68 | mux_name = ghb_dict_get_string(settings, "FileFormat"); |
| 69 | mux = hb_container_get_from_name(mux_name); |
| 70 | |
| 71 | acodec = ghb_settings_audio_encoder_codec(asettings, "Encoder"); |
| 72 | fallback = ghb_select_fallback(settings, acodec); |
| 73 | copy_mask = ghb_get_copy_mask(settings); |
| 74 | track = ghb_dict_get_int(asettings, "Track"); |
| 75 | aconfig = ghb_get_audio_info(title, track); |
| 76 | if (aconfig != NULL) |
| 77 | { |
| 78 | in_codec = aconfig->in.codec; |
| 79 | } |
| 80 | acodec = ghb_select_audio_codec(mux, in_codec, acodec, |
| 81 | fallback, copy_mask); |
| 82 | ghb_dict_set_string(asettings, "Encoder", |
| 83 | hb_audio_encoder_get_short_name(acodec)); |
| 84 | |
| 85 | // Sanitize the rest |
| 86 | hb_sanitize_audio_settings(title, asettings); |
| 87 | } |
| 88 | |
| 89 | static gdouble get_quality(int codec, gdouble quality) |
| 90 | { |
no test coverage detected