diff options
author | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2013-07-18 21:34:29 +0000 |
---|---|---|
committer | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2013-07-18 21:34:29 +0000 |
commit | 36021280b42ab0f04d762acbaa0814085d89ce55 (patch) | |
tree | 76c62157c28b0c79910fc2a4c56e6a4f59f26fc8 | |
parent | ea12deb3248317b79ab12c056a00b69382e35e73 (diff) | |
download | usdx-36021280b42ab0f04d762acbaa0814085d89ce55.tar.gz usdx-36021280b42ab0f04d762acbaa0814085d89ce55.tar.xz usdx-36021280b42ab0f04d762acbaa0814085d89ce55.zip |
fix version detection of libavformat
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3000 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r-- | src/media/UAudioDecoder_FFmpeg.pas | 12 | ||||
-rw-r--r-- | src/media/UMediaCore_FFmpeg.pas | 6 | ||||
-rw-r--r-- | src/media/UVideo.pas | 12 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/media/UAudioDecoder_FFmpeg.pas b/src/media/UAudioDecoder_FFmpeg.pas index 5df42ff7..7d62d761 100644 --- a/src/media/UAudioDecoder_FFmpeg.pas +++ b/src/media/UAudioDecoder_FFmpeg.pas @@ -290,10 +290,10 @@ begin Self.fFilename := Filename; // use custom 'ufile' protocol for UTF-8 support - {$IF LIBAVFORMAT_VERSION < 54029104} - AVResult := avformat_open_input(@fFormatCtx, PAnsiChar('ufile:'+FileName.ToUTF8), nil, nil); - {$ELSEIF LIBAVFORMAT_VERSION < 53001003} + {$IF LIBAVFORMAT_VERSION < 53001003} AVResult := av_open_input_file(fFormatCtx, PAnsiChar('ufile:'+FileName.ToUTF8), nil, 0, nil); + {$ELSEIF LIBAVFORMAT_VERSION < 54029104} + AVResult := avformat_open_input(@fFormatCtx, PAnsiChar('ufile:'+FileName.ToUTF8), nil, nil); {$ELSE} AVResult := FFmpegCore.AVFormatOpenInput(@fFormatCtx, PAnsiChar('ufile:'+FileName.ToUTF8)); {$IFEND} @@ -464,10 +464,10 @@ begin // Close the video file if (fFormatCtx <> nil) then begin - {$IF LIBAVFORMAT_VERSION < 54029104} - avformat_close_input(@fFormatCtx); - {$ELSEIF LIBAVFORMAT_VERSION < 53024002} + {$IF LIBAVFORMAT_VERSION < 53024002} av_close_input_file(fFormatCtx); + {$ELSEIF LIBAVFORMAT_VERSION < 54029104} + avformat_close_input(@fFormatCtx); {$ELSE} FFmpegCore.AVFormatCloseInput(@fFormatCtx); {$IFEND} diff --git a/src/media/UMediaCore_FFmpeg.pas b/src/media/UMediaCore_FFmpeg.pas index 1b794c7e..d2fe9185 100644 --- a/src/media/UMediaCore_FFmpeg.pas +++ b/src/media/UMediaCore_FFmpeg.pas @@ -212,10 +212,10 @@ begin CheckVersions(); - {$IF LIBAVFORMAT_VERSION < 54029104} - av_register_protocol2(@UTF8FileProtocol, sizeof(UTF8FileProtocol)); - {$ELSEIF LIBAVFORMAT_VERSION <= 52111000} // 52.110.0 + {$IF LIBAVFORMAT_VERSION <= 52111000} // 52.110.0 av_register_protocol(@UTF8FileProtocol); + {$ELSEIF LIBAVFORMAT_VERSION < 54029104} + av_register_protocol2(@UTF8FileProtocol, sizeof(UTF8FileProtocol)); {$IFEND} AVCodecLock := SDL_CreateMutex(); diff --git a/src/media/UVideo.pas b/src/media/UVideo.pas index 949a66c2..1c4f065d 100644 --- a/src/media/UVideo.pas +++ b/src/media/UVideo.pas @@ -323,10 +323,10 @@ begin fPboEnabled := PboSupported; // use custom 'ufile' protocol for UTF-8 support - {$IF LIBAVFORMAT_VERSION < 54029104} - errnum := avformat_open_input(@fFormatContext, PAnsiChar('ufile:'+FileName.ToUTF8), nil, nil); - {$ELSEIF LIBAVFORMAT_VERSION < 53001003} + {$IF LIBAVFORMAT_VERSION < 53001003} errnum := av_open_input_file(fFormatContext, PAnsiChar('ufile:'+FileName.ToUTF8), nil, 0, nil); + {$ELSEIF LIBAVFORMAT_VERSION < 54029104} + errnum := avformat_open_input(@fFormatContext, PAnsiChar('ufile:'+FileName.ToUTF8), nil, nil); {$ELSE} errnum := FFmpegCore.AVFormatOpenInput(@fFormatContext, PAnsiChar('ufile:'+FileName.ToUTF8)); {$IFEND} @@ -586,10 +586,10 @@ begin end; if (fFormatContext <> nil) then - {$IF LIBAVFORMAT_VERSION < 54029104} - avformat_close_input(@fFormatContext); - {$ELSEIF LIBAVFORMAT_VERSION < 53024002)} + {$IF LIBAVFORMAT_VERSION < 53024002)} av_close_input_file(fFormatContext); + {$ELSEIF LIBAVFORMAT_VERSION < 54029104} + avformat_close_input(@fFormatContext); {$ELSE} FFmpegCore.AVFormatCloseInput(@fFormatContext); {$IFEND} |