| 3231 | } |
| 3232 | |
| 3233 | int 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 | |
| 3263 | fail: |
| 3264 | return HB_ACODEC_INVALID; |
| 3265 | } |
| 3266 | |
| 3267 | hb_encoder_t* hb_audio_encoder_get_from_codec(int codec) |
| 3268 | { |