From 0f691788bae9667a02ea530e00d7ae9f52416ea8 Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Thu, 1 Jun 2023 01:06:38 -0400 Subject: [PATCH] Fix for ffmpeg4 --- torchaudio/csrc/ffmpeg/libav.cpp | 8 ++++---- torchaudio/csrc/ffmpeg/macro.h | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/torchaudio/csrc/ffmpeg/libav.cpp b/torchaudio/csrc/ffmpeg/libav.cpp index d2e09bab925..a9954725ce0 100644 --- a/torchaudio/csrc/ffmpeg/libav.cpp +++ b/torchaudio/csrc/ffmpeg/libav.cpp @@ -3,10 +3,10 @@ #include extern "C" { -#include -#include -#include -#include +#include +#include +#include +#include #include } diff --git a/torchaudio/csrc/ffmpeg/macro.h b/torchaudio/csrc/ffmpeg/macro.h index d701614eae6..aa287472fcc 100644 --- a/torchaudio/csrc/ffmpeg/macro.h +++ b/torchaudio/csrc/ffmpeg/macro.h @@ -1,9 +1,13 @@ #pragma once extern "C" { -#include +#include } +#ifndef LIBAVFORMAT_VERSION_MAJOR +#error LIBAVFORMAT_VERSION_MAJOR is not defined. +#endif + #if LIBAVFORMAT_VERSION_MAJOR >= 59 #define AVFORMAT_CONST const #else