summaryrefslogtreecommitdiffstats
path: root/src/encoder
diff options
context:
space:
mode:
authorRJ Skerry-Ryan <rryan@mixxx.org>2018-04-23 20:27:17 -0700
committerRJ Skerry-Ryan <rryan@mixxx.org>2018-04-23 20:27:17 -0700
commit54d15e3b6d6878131e36f2dac8d1b6180a8bf06b (patch)
tree6106701837060ae74d997aae69153118c9aabdf6 /src/encoder
parent9a44a3cc5239727d9549f16208b72deb42e38d7c (diff)
parenta93f79f2ca717268dfafd072df911cb10d2e215d (diff)
Merge branch '2.1'
Diffstat (limited to 'src/encoder')
-rw-r--r--src/encoder/encoderffmpegcore.cpp11
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;
}