diff options
author | lotanrm <lotanrm@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2013-07-11 08:55:30 +0000 |
---|---|---|
committer | lotanrm <lotanrm@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2013-07-11 08:55:30 +0000 |
commit | bd2ba8c9437c0c3bd4e84841f322501166145a6a (patch) | |
tree | c973560b1e706f87b03425329e54928dd29fdb3d /src/media/UAudioDecoder_FFmpeg.pas | |
parent | 2596ea5ea76e3a6bb46ce1c7c5da3ea33bcda031 (diff) | |
download | usdx-bd2ba8c9437c0c3bd4e84841f322501166145a6a.tar.gz usdx-bd2ba8c9437c0c3bd4e84841f322501166145a6a.tar.xz usdx-bd2ba8c9437c0c3bd4e84841f322501166145a6a.zip |
In order to make ffmpeg-1.0 work:
Fixed avcodec FF_API flags (similar to r2996).
Changed from old avformat_register_protocol2 to using AVIOContext.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2998 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | src/media/UAudioDecoder_FFmpeg.pas | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/media/UAudioDecoder_FFmpeg.pas b/src/media/UAudioDecoder_FFmpeg.pas index 21322064..5df42ff7 100644 --- a/src/media/UAudioDecoder_FFmpeg.pas +++ b/src/media/UAudioDecoder_FFmpeg.pas @@ -290,10 +290,12 @@ begin Self.fFilename := Filename; // use custom 'ufile' protocol for UTF-8 support - {$IF LIBAVFORMAT_VERSION >= 53001003)} + {$IF LIBAVFORMAT_VERSION < 54029104} AVResult := avformat_open_input(@fFormatCtx, PAnsiChar('ufile:'+FileName.ToUTF8), nil, nil); - {$ELSE} + {$ELSEIF LIBAVFORMAT_VERSION < 53001003} AVResult := av_open_input_file(fFormatCtx, PAnsiChar('ufile:'+FileName.ToUTF8), nil, 0, nil); + {$ELSE} + AVResult := FFmpegCore.AVFormatOpenInput(@fFormatCtx, PAnsiChar('ufile:'+FileName.ToUTF8)); {$IFEND} if (AVResult <> 0) then begin @@ -462,10 +464,12 @@ begin // Close the video file if (fFormatCtx <> nil) then begin - {$IF LIBAVFORMAT_VERSION >= 53024002)} + {$IF LIBAVFORMAT_VERSION < 54029104} avformat_close_input(@fFormatCtx); - {$ELSE} + {$ELSEIF LIBAVFORMAT_VERSION < 53024002} av_close_input_file(fFormatCtx); + {$ELSE} + FFmpegCore.AVFormatCloseInput(@fFormatCtx); {$IFEND} fFormatCtx := nil; end; |