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

Function hb_mixdown_get_best

libhb/common.c:2872–2891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2870}
2871
2872int hb_mixdown_get_best(uint32_t codec, hb_channel_layout_t *ch_layout, int mixdown)
2873{
2874 // Passthru, only "None" mixdown is supported
2875 if (codec & HB_ACODEC_PASS_FLAG)
2876 return HB_AMIXDOWN_NONE;
2877
2878 int best_mixdown = HB_INVALID_AMIXDOWN;
2879 const hb_mixdown_t *audio_mixdown = hb_mixdown_get_next(NULL);
2880 // test all non-None mixdowns while the value is <= the requested mixdown
2881 // HB_INVALID_AMIXDOWN means the highest supported mixdown was requested
2882 while ((audio_mixdown = hb_mixdown_get_next(audio_mixdown)) != NULL)
2883 {
2884 if ((mixdown == HB_INVALID_AMIXDOWN || audio_mixdown->amixdown <= mixdown) &&
2885 (hb_mixdown_is_supported(audio_mixdown->amixdown, codec, ch_layout)))
2886 {
2887 best_mixdown = audio_mixdown->amixdown;
2888 }
2889 }
2890 return best_mixdown;
2891}
2892
2893int hb_mixdown_get_best_s(uint32_t codec, const char *layout, int mixdown)
2894{

Callers 5

sanitize_audioFunction · 0.85
hb_mixdown_get_best_sFunction · 0.85
hb_mixdown_get_defaultFunction · 0.85

Calls 2

hb_mixdown_get_nextFunction · 0.85
hb_mixdown_is_supportedFunction · 0.85

Tested by

no test coverage detected