diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2018-04-23 19:18:15 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2018-04-23 21:30:03 +0200 |
commit | 77222e981632d4460d9192dd7ad2790a4eeeee41 (patch) | |
tree | 8c38994b15c9127571c090eb23c232a8d61c510c /src/encoder | |
parent | a2631e0e12626e0ed03e7a984c9e1a15bc30bbb9 (diff) |
Fix FFmpeg build issues caused by version dependencies
Diffstat (limited to 'src/encoder')
-rw-r--r-- | src/encoder/encoderffmpegcore.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/encoder/encoderffmpegcore.cpp b/src/encoder/encoderffmpegcore.cpp index e682907916..11bdc6e49d 100644 --- a/src/encoder/encoderffmpegcore.cpp +++ b/src/encoder/encoderffmpegcore.cpp @@ -457,7 +457,11 @@ int EncoderFfmpegCore::openAudio(AVCodec *codec, AVStream *stream) { return -1; } +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 89, 100) + if (l_SCodecCtx->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) { +#else if (l_SCodecCtx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) { +#endif m_iAudioInputFrameSize = 10000; } else { m_iAudioInputFrameSize = l_SCodecCtx->frame_size; @@ -533,8 +537,13 @@ AVStream *EncoderFfmpegCore::addStream(AVFormatContext *formatctx, // Some formats want stream headers to be separate. - if (formatctx->oformat->flags & AVFMT_GLOBALHEADER) + if (formatctx->oformat->flags & AVFMT_GLOBALHEADER) { +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 89, 100) + l_SCodecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; +#else l_SCodecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER; +#endif + } return l_SStream; } |