aboutsummaryrefslogtreecommitdiffstats
path: root/src/media
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2012-04-20 19:54:15 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2012-04-20 19:54:15 +0000
commit170917432bdc4e1c52d0fe7ac9bf539cacc2f5f8 (patch)
treea3777f7cc3680b76d298a520a407170ef8143285 /src/media
parent9bc840d97697bc6445aab17368bad58d02018a2a (diff)
downloadusdx-170917432bdc4e1c52d0fe7ac9bf539cacc2f5f8.tar.gz
usdx-170917432bdc4e1c52d0fe7ac9bf539cacc2f5f8.tar.xz
usdx-170917432bdc4e1c52d0fe7ac9bf539cacc2f5f8.zip
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
Diffstat (limited to 'src/media')
-rw-r--r--src/media/UAudioDecoder_FFmpeg.pas1
-rw-r--r--src/media/UMediaCore_FFmpeg.pas14
2 files changed, 7 insertions, 8 deletions
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;