1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 16:40:07 +02:00

FFmpeg: Add support for libav 0.8.

Thanks to Michael Niedermayer for the tips.
This commit is contained in:
benjamin.drung@gmail.com 2014-05-29 21:04:45 +00:00
parent ffe29894b8
commit b5fd9bc068
2 changed files with 8 additions and 0 deletions

View File

@ -110,6 +110,12 @@ extern "C" {
#define AV_CODEC_ID_WMAV2 CODEC_ID_WMAV2
#define AV_CODEC_ID_WMAVOICE CODEC_ID_WMAVOICE
#endif
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 8, 100)
inline bool av_codec_is_encoder(AVCodec *codec) {
return codec != NULL && (codec->encode != NULL || codec->encode2 != NULL);
}
#endif
}
#endif

View File

@ -538,7 +538,9 @@ static int encode_audio(AVCodecContext *avctx, AVPacket *pkt, int16_t *audio_sam
frame->nb_samples = nb_samples;
frame->format = avctx->sample_fmt;
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 13, 0))
frame->channel_layout = avctx->channel_layout;
#endif
buffer_size = av_samples_get_buffer_size(NULL, avctx->channels, frame->nb_samples,
avctx->sample_fmt, 0);