From 170917432bdc4e1c52d0fe7ac9bf539cacc2f5f8 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Fri, 20 Apr 2012 19:54:15 +0000 Subject: new detection of ffmpeg version. API changes: SampleFormat -> AVSampleFormat. Configure still needs update. Special thanks to lotan. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2856 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/media/UAudioDecoder_FFmpeg.pas | 1 - src/media/UMediaCore_FFmpeg.pas | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/media') diff --git a/src/media/UAudioDecoder_FFmpeg.pas b/src/media/UAudioDecoder_FFmpeg.pas index b44c7b11..d5295135 100644 --- a/src/media/UAudioDecoder_FFmpeg.pas +++ b/src/media/UAudioDecoder_FFmpeg.pas @@ -64,7 +64,6 @@ uses avformat, avutil, avio, - mathematics, // used for av_rescale_q rational, UMusic, UIni, diff --git a/src/media/UMediaCore_FFmpeg.pas b/src/media/UMediaCore_FFmpeg.pas index eb136995..f04ee7eb 100644 --- a/src/media/UMediaCore_FFmpeg.pas +++ b/src/media/UMediaCore_FFmpeg.pas @@ -92,7 +92,7 @@ type function GetErrorString(ErrorNum: integer): string; function FindStreamIDs(FormatCtx: PAVFormatContext; out FirstVideoStream, FirstAudioStream: integer ): boolean; function FindAudioStreamIndex(FormatCtx: PAVFormatContext): integer; - function ConvertFFmpegToAudioFormat(FFmpegFormat: TSampleFormat; out Format: TAudioSampleFormat): boolean; + function ConvertFFmpegToAudioFormat(FFmpegFormat: TAVSampleFormat; out Format: TAudioSampleFormat): boolean; procedure LockAVCodec(); procedure UnlockAVCodec(); end; @@ -320,14 +320,14 @@ begin Result := StreamIndex; end; -function TMediaCore_FFmpeg.ConvertFFmpegToAudioFormat(FFmpegFormat: TSampleFormat; out Format: TAudioSampleFormat): boolean; +function TMediaCore_FFmpeg.ConvertFFmpegToAudioFormat(FFmpegFormat: TAVSampleFormat; out Format: TAudioSampleFormat): boolean; begin case FFmpegFormat of - SAMPLE_FMT_U8: Format := asfU8; - SAMPLE_FMT_S16: Format := asfS16; - SAMPLE_FMT_S32: Format := asfS32; - SAMPLE_FMT_FLT: Format := asfFloat; - SAMPLE_FMT_DBL: Format := asfDouble; + AV_SAMPLE_FMT_U8: Format := asfU8; + AV_SAMPLE_FMT_S16: Format := asfS16; + AV_SAMPLE_FMT_S32: Format := asfS32; + AV_SAMPLE_FMT_FLT: Format := asfFloat; + AV_SAMPLE_FMT_DBL: Format := asfDouble; else begin Result := false; Exit; -- cgit v1.2.3