From bd2ba8c9437c0c3bd4e84841f322501166145a6a Mon Sep 17 00:00:00 2001 From: lotanrm Date: Thu, 11 Jul 2013 08:55:30 +0000 Subject: 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 --- src/media/UVideo.pas | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/media/UVideo.pas') diff --git a/src/media/UVideo.pas b/src/media/UVideo.pas index a4b12962..949a66c2 100644 --- a/src/media/UVideo.pas +++ b/src/media/UVideo.pas @@ -323,10 +323,12 @@ begin fPboEnabled := PboSupported; // use custom 'ufile' protocol for UTF-8 support - {$IF LIBAVFORMAT_VERSION >= 53001003)} + {$IF LIBAVFORMAT_VERSION < 54029104} errnum := avformat_open_input(@fFormatContext, PAnsiChar('ufile:'+FileName.ToUTF8), nil, nil); - {$ELSE} + {$ELSEIF LIBAVFORMAT_VERSION < 53001003} errnum := av_open_input_file(fFormatContext, PAnsiChar('ufile:'+FileName.ToUTF8), nil, 0, nil); + {$ELSE} + errnum := FFmpegCore.AVFormatOpenInput(@fFormatContext, PAnsiChar('ufile:'+FileName.ToUTF8)); {$IFEND} if (errnum <> 0) then begin @@ -584,10 +586,12 @@ begin end; if (fFormatContext <> nil) then - {$IF LIBAVFORMAT_VERSION >= 53024002)} + {$IF LIBAVFORMAT_VERSION < 54029104} avformat_close_input(@fFormatContext); - {$ELSE} + {$ELSEIF LIBAVFORMAT_VERSION < 53024002)} av_close_input_file(fFormatContext); + {$ELSE} + FFmpegCore.AVFormatCloseInput(@fFormatContext); {$IFEND} fCodecContext := nil; -- cgit v1.2.3