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

Function ghb_sanitize_audio_settings

gtk/src/audiohandler.c:55–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55static void
56ghb_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
89static gdouble get_quality(int codec, gdouble quality)
90{

Callers 4

sanitize_audio_tracksFunction · 0.85
audio_add_trackFunction · 0.85

Calls 12

ghb_dict_get_intFunction · 0.85
ghb_lookup_titleFunction · 0.85
ghb_dict_get_stringFunction · 0.85
ghb_select_fallbackFunction · 0.85
ghb_get_copy_maskFunction · 0.85
ghb_get_audio_infoFunction · 0.85
ghb_select_audio_codecFunction · 0.85
ghb_dict_set_stringFunction · 0.85

Tested by

no test coverage detected