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

Function hb_audio_encoder_get_fallback_for_passthru

libhb/common.c:3184–3231  ·  view source on GitHub ↗

for a valid passthru, return the matching encoder for that codec (if any), else return -1 (i.e. drop the track)

Source from the content-addressed store, hash-verified

3182// for a valid passthru, return the matching encoder for that codec (if any),
3183// else return -1 (i.e. drop the track)
3184int hb_audio_encoder_get_fallback_for_passthru(int passthru)
3185{
3186 int gid;
3187 const hb_encoder_t *audio_encoder = NULL;
3188 switch (passthru)
3189 {
3190 case HB_ACODEC_ALAC_PASS:
3191 gid = HB_GID_ACODEC_ALAC;
3192 break;
3193
3194 case HB_ACODEC_AAC_PASS:
3195 gid = HB_GID_ACODEC_AAC;
3196 break;
3197
3198 case HB_ACODEC_AC3_PASS:
3199 gid = HB_GID_ACODEC_AC3;
3200 break;
3201
3202 case HB_ACODEC_EAC3_PASS:
3203 gid = HB_GID_ACODEC_EAC3;
3204 break;
3205
3206 case HB_ACODEC_FLAC_PASS:
3207 gid = HB_GID_ACODEC_FLAC;
3208 break;
3209
3210 case HB_ACODEC_MP3_PASS:
3211 gid = HB_GID_ACODEC_MP3;
3212 break;
3213
3214 default:
3215 return HB_ACODEC_INVALID;
3216 break;
3217 }
3218 while ((audio_encoder = hb_audio_encoder_get_next(audio_encoder)) != NULL)
3219 {
3220 if (((hb_encoder_internal_t*)audio_encoder)->gid == gid)
3221 {
3222 return audio_encoder->codec;
3223 }
3224 }
3225
3226 // passthru tracks are often the second audio from the same source track
3227 // if we don't have an encoder matching the passthru codec, return INVALID
3228 // dropping the track, as well as ensuring that there is at least one
3229 // audio track in the output is then up to the UIs
3230 return HB_ACODEC_INVALID;
3231}
3232
3233int hb_audio_encoder_get_default(int muxer)
3234{

Callers 2

sanitize_audio_codecFunction · 0.85
ghb_select_fallbackFunction · 0.85

Calls 1

Tested by

no test coverage detected