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

Function hb_audio_encoder_get_default

libhb/common.c:3233–3265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3231}
3232
3233int hb_audio_encoder_get_default(int muxer)
3234{
3235 if (!(muxer & HB_MUX_MASK))
3236 goto fail;
3237
3238 int codec = 0;
3239 const hb_encoder_t *audio_encoder = NULL;
3240 while ((audio_encoder = hb_audio_encoder_get_next(audio_encoder)) != NULL)
3241 {
3242 // default encoder should not be passthru
3243 if ((audio_encoder->muxers & muxer) &&
3244 (audio_encoder->codec & HB_ACODEC_PASS_FLAG) == 0)
3245 {
3246 codec = audio_encoder->codec;
3247 break;
3248 }
3249 }
3250
3251 // Lame is better than our low-end AAC encoders
3252 // if the container is MKV, use the former
3253 // AAC is still used when the container is MP4 (for better compatibility)
3254 if (codec == HB_ACODEC_FFAAC && (muxer & HB_MUX_MASK_MKV) == muxer)
3255 {
3256 return HB_ACODEC_LAME;
3257 }
3258 else
3259 {
3260 return codec;
3261 }
3262
3263fail:
3264 return HB_ACODEC_INVALID;
3265}
3266
3267hb_encoder_t* hb_audio_encoder_get_from_codec(int codec)
3268{

Callers 7

sanitize_audio_codecFunction · 0.85
preset_cleanFunction · 0.85
hb_audio_config_initFunction · 0.85
PreparePresetFunction · 0.85
PrepareJobFunction · 0.85
ghb_validate_audioFunction · 0.85
ghb_select_audio_codecFunction · 0.85

Calls 1

Tested by 2

PreparePresetFunction · 0.68
PrepareJobFunction · 0.68