aboutsummaryrefslogtreecommitdiffstats
path: root/src/media/UMediaCore_FFmpeg.pas
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-05-12 11:37:31 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-05-12 11:37:31 +0000
commit2a8098bc38661d97e3e7dcf61898797ea3427a4f (patch)
tree69b75201440acf20957d4881a2daf52846025b8b /src/media/UMediaCore_FFmpeg.pas
parentc99aeae03ebbf61fda758636708bf5a0ff83aed0 (diff)
downloadusdx-2a8098bc38661d97e3e7dcf61898797ea3427a4f.tar.gz
usdx-2a8098bc38661d97e3e7dcf61898797ea3427a4f.tar.xz
usdx-2a8098bc38661d97e3e7dcf61898797ea3427a4f.zip
fix No. 2 of ffmpeg update. Move from CodecType to AVMediaType.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2364 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/media/UMediaCore_FFmpeg.pas')
-rw-r--r--src/media/UMediaCore_FFmpeg.pas22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/media/UMediaCore_FFmpeg.pas b/src/media/UMediaCore_FFmpeg.pas
index 9eab7621..2d572ff2 100644
--- a/src/media/UMediaCore_FFmpeg.pas
+++ b/src/media/UMediaCore_FFmpeg.pas
@@ -99,7 +99,8 @@ type
implementation
uses
- SysUtils;
+ SysUtils,
+ UConfig;
function FFmpegStreamOpen(h: PURLContext; filename: PChar; flags: cint): cint; cdecl; forward;
function FFmpegStreamRead(h: PURLContext; buf: PByteArray; size: cint): cint; cdecl; forward;
@@ -184,6 +185,7 @@ begin
begin
Stream := FormatCtx.streams[i];
+{$IF LIBAVCODEC_VERSION < 52064000} // < 52.64.0
if (Stream.codec.codec_type = CODEC_TYPE_VIDEO) and
(FirstVideoStream < 0) then
begin
@@ -196,6 +198,20 @@ begin
FirstAudioStream := i;
end;
end;
+{$ELSE}
+ if (Stream.codec.codec_type = AVMEDIA_TYPE_VIDEO) and
+ (FirstVideoStream < 0) then
+ begin
+ FirstVideoStream := i;
+ end;
+
+ if (Stream.codec.codec_type = AVMEDIA_TYPE_AUDIO) and
+ (FirstAudioStream < 0) then
+ begin
+ FirstAudioStream := i;
+ end;
+ end;
+{$IFEND}
// return true if either an audio- or video-stream was found
Result := (FirstAudioStream > -1) or
@@ -215,7 +231,11 @@ begin
begin
Stream := FormatCtx^.streams[i];
+{$IF LIBAVCODEC_VERSION < 52064000} // < 52.64.0
if (Stream.codec^.codec_type = CODEC_TYPE_AUDIO) then
+{$ELSE}
+ if (Stream.codec^.codec_type = AVMEDIA_TYPE_AUDIO) then
+{$IFEND}
begin
StreamIndex := i;
Break;