diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp | 16 | ||||
-rw-r--r-- | intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp | 10 | ||||
-rw-r--r-- | intern/ffmpeg/ffmpeg_compat.h | 15 |
3 files changed, 27 insertions, 14 deletions
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp index 6553073c54e..28a14a9cfc7 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp @@ -143,23 +143,23 @@ void AUD_FFMPEGReader::init() switch(m_codecCtx->sample_fmt) { - case SAMPLE_FMT_U8: + case AV_SAMPLE_FMT_U8: m_convert = AUD_convert_u8_float; m_specs.format = AUD_FORMAT_U8; break; - case SAMPLE_FMT_S16: + case AV_SAMPLE_FMT_S16: m_convert = AUD_convert_s16_float; m_specs.format = AUD_FORMAT_S16; break; - case SAMPLE_FMT_S32: + case AV_SAMPLE_FMT_S32: m_convert = AUD_convert_s32_float; m_specs.format = AUD_FORMAT_S32; break; - case SAMPLE_FMT_FLT: + case AV_SAMPLE_FMT_FLT: m_convert = AUD_convert_copy<float>; m_specs.format = AUD_FORMAT_FLOAT32; break; - case SAMPLE_FMT_DBL: + case AV_SAMPLE_FMT_DBL: m_convert = AUD_convert_double_float; m_specs.format = AUD_FORMAT_FLOAT64; break; @@ -189,7 +189,7 @@ AUD_FFMPEGReader::AUD_FFMPEGReader(std::string filename) : } catch(AUD_Exception&) { - av_close_input_file(m_formatCtx); + avformat_close_input(&m_formatCtx); throw; } } @@ -227,7 +227,7 @@ AUD_FFMPEGReader::AUD_FFMPEGReader(AUD_Reference<AUD_Buffer> buffer) : } catch(AUD_Exception&) { - av_close_input_stream(m_formatCtx); + avformat_close_input(&m_formatCtx); av_free(m_aviocontext); throw; } @@ -239,7 +239,7 @@ AUD_FFMPEGReader::~AUD_FFMPEGReader() if(m_aviocontext) { - av_close_input_stream(m_formatCtx); + avformat_close_input(&m_formatCtx); av_free(m_aviocontext); } else diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp index 702c366c4df..2b34348da81 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp @@ -133,23 +133,23 @@ AUD_FFMPEGWriter::AUD_FFMPEGWriter(std::string filename, AUD_DeviceSpecs specs, { case AUD_FORMAT_U8: m_convert = AUD_convert_float_u8; - m_codecCtx->sample_fmt = SAMPLE_FMT_U8; + m_codecCtx->sample_fmt = AV_SAMPLE_FMT_U8; break; case AUD_FORMAT_S16: m_convert = AUD_convert_float_s16; - m_codecCtx->sample_fmt = SAMPLE_FMT_S16; + m_codecCtx->sample_fmt = AV_SAMPLE_FMT_S16; break; case AUD_FORMAT_S32: m_convert = AUD_convert_float_s32; - m_codecCtx->sample_fmt = SAMPLE_FMT_S32; + m_codecCtx->sample_fmt = AV_SAMPLE_FMT_S32; break; case AUD_FORMAT_FLOAT32: m_convert = AUD_convert_copy<float>; - m_codecCtx->sample_fmt = SAMPLE_FMT_FLT; + m_codecCtx->sample_fmt = AV_SAMPLE_FMT_FLT; break; case AUD_FORMAT_FLOAT64: m_convert = AUD_convert_float_double; - m_codecCtx->sample_fmt = SAMPLE_FMT_DBL; + m_codecCtx->sample_fmt = AV_SAMPLE_FMT_DBL; break; default: AUD_THROW(AUD_ERROR_FFMPEG, format_error); diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index 9dbbb46ce40..703c528bdea 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -40,7 +40,6 @@ #endif #include <libswscale/swscale.h> -#include <libavcodec/opt.h> #if (LIBAVFORMAT_VERSION_MAJOR > 52) || ((LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 105)) #define FFMPEG_HAVE_AVIO 1 @@ -76,6 +75,20 @@ #define FFMPEG_FFV1_ALPHA_SUPPORTED #endif +#if ((LIBAVFORMAT_VERSION_MAJOR < 53) || ((LIBAVFORMAT_VERSION_MAJOR == 53) && (LIBAVFORMAT_VERSION_MINOR < 24)) || ((LIBAVFORMAT_VERSION_MAJOR == 53) && (LIBAVFORMAT_VERSION_MINOR < 24) && (LIBAVFORMAT_VERSION_MICRO < 2))) +#define avformat_close_input(x) av_close_input_file(*(x)) +#endif + +#if ((LIBAVFORMAT_VERSION_MAJOR > 53) || ((LIBAVFORMAT_VERSION_MAJOR == 53) && (LIBAVFORMAT_VERSION_MINOR > 32)) || ((LIBAVFORMAT_VERSION_MAJOR == 53) && (LIBAVFORMAT_VERSION_MINOR == 24) && (LIBAVFORMAT_VERSION_MICRO >= 100))) +void ff_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp); + +static inline +void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp) +{ + ff_update_cur_dts(s, ref_st, timestamp); +} +#endif + #ifndef FFMPEG_HAVE_AVIO #define AVIO_FLAG_WRITE URL_WRONLY #define avio_open url_fopen |