summaryrefslogtreecommitdiff
path: root/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp')
-rw-r--r--dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
index 178608036..87444d925 100644
--- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
@@ -61,15 +61,21 @@ FFmpegDataDecoder<LIBAV_VER>::Init()
mCodecContext->extradata_size = mExtraData->Length();
// FFmpeg may use SIMD instructions to access the data which reads the
// data in 32 bytes block. Must ensure we have enough data to read.
+#if LIBAVCODEC_VERSION_MAJOR >= 58
+ mExtraData->AppendElements(AV_INPUT_BUFFER_PADDING_SIZE);
+#else
mExtraData->AppendElements(FF_INPUT_BUFFER_PADDING_SIZE);
+#endif
mCodecContext->extradata = mExtraData->Elements();
} else {
mCodecContext->extradata_size = 0;
}
+#if LIBAVCODEC_VERSION_MAJOR < 57
if (codec->capabilities & CODEC_CAP_DR1) {
mCodecContext->flags |= CODEC_FLAG_EMU_EDGE;
}
+#endif
if (avcodec_open2(mCodecContext, codec, nullptr) < 0) {
NS_WARNING("Couldn't initialise ffmpeg decoder");