From 2a8098bc38661d97e3e7dcf61898797ea3427a4f Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 12 May 2010 11:37:31 +0000 Subject: 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 --- src/media/UMediaCore_FFmpeg.pas | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3