aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlotanrm <lotanrm@b956fd51-792f-4845-bead-9b4dfca2ff2c>2012-05-17 23:05:25 +0000
committerlotanrm <lotanrm@b956fd51-792f-4845-bead-9b4dfca2ff2c>2012-05-17 23:05:25 +0000
commit7d523b59769a7a99afdfe365ced3c6727018cf5a (patch)
treeb8c084ae0e6e809723c15db7d8bf0f2fb8531b27
parentc03bb84ce50794bab234b1c5cbfa74f6e8e3c6f2 (diff)
downloadusdx-7d523b59769a7a99afdfe365ced3c6727018cf5a.tar.gz
usdx-7d523b59769a7a99afdfe365ced3c6727018cf5a.tar.xz
usdx-7d523b59769a7a99afdfe365ced3c6727018cf5a.zip
Corrected AVStream pointer arithmetic to work inconjuction with fpc 2.6 as well fpc 2.4. Removed unneeded code.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2884 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--src/media/UAudioDecoder_FFmpeg.pas6
-rw-r--r--src/media/UMediaCore_FFmpeg.pas4
-rw-r--r--src/media/UVideo.pas2
3 files changed, 4 insertions, 8 deletions
diff --git a/src/media/UAudioDecoder_FFmpeg.pas b/src/media/UAudioDecoder_FFmpeg.pas
index 792655b2..6db1454d 100644
--- a/src/media/UAudioDecoder_FFmpeg.pas
+++ b/src/media/UAudioDecoder_FFmpeg.pas
@@ -345,7 +345,7 @@ begin
{$IF LIBAVFORMAT_VERSION <= 52111000} // <= 52.111.0
fAudioStream := fFormatCtx.streams[fAudioStreamIndex];
{$ELSE}
- fAudioStream := (fFormatCtx.streams + fAudioStreamIndex)^;
+ fAudioStream := PPAVStream(PtrUInt(fFormatCtx.streams) + fAudioStreamIndex * Sizeof(pointer))^;
{$IFEND}
fAudioStreamPos := 0;
fCodecCtx := fAudioStream^.codec;
@@ -936,10 +936,6 @@ var
{$IFDEF DebugFFmpegDecode}
TmpPos: double;
{$ENDIF}
- {$IF LIBAVCODEC_VERSION >= 5300500}
- AVFrame: PAVFrame;
- got_frame_ptr: integer;
- {$IFEND}
begin
Result := -1;
diff --git a/src/media/UMediaCore_FFmpeg.pas b/src/media/UMediaCore_FFmpeg.pas
index dd8ddf07..c9e61c4a 100644
--- a/src/media/UMediaCore_FFmpeg.pas
+++ b/src/media/UMediaCore_FFmpeg.pas
@@ -270,7 +270,7 @@ begin
{$IF LIBAVFORMAT_VERSION <= 52111000} // <= 52.111.0
Stream := FormatCtx.streams[i];
{$ELSE}
- Stream := (FormatCtx.streams + i)^;
+ Stream := PPAVStream(PtrUInt(FormatCtx.streams) + i * Sizeof(pointer))^;
{$IFEND}
{$IF LIBAVCODEC_VERSION < 52064000} // < 52.64.0
@@ -320,7 +320,7 @@ begin
{$IF LIBAVFORMAT_VERSION <= 52111000} // <= 52.111.0
Stream := FormatCtx^.streams[i];
{$ELSE}
- Stream := (FormatCtx^.streams + i)^;
+ Stream := PPAVStream(PtrUInt(FormatCtx^.streams) + i * Sizeof(pointer))^;
{$IFEND}
{$IF LIBAVCODEC_VERSION < 52064000} // < 52.64.0
diff --git a/src/media/UVideo.pas b/src/media/UVideo.pas
index eaffa9ea..605eec78 100644
--- a/src/media/UVideo.pas
+++ b/src/media/UVideo.pas
@@ -359,7 +359,7 @@ begin
{$IF LIBAVFORMAT_VERSION <= 52111000} // <= 52.111.0
fStream := fFormatContext^.streams[fStreamIndex];
{$ELSE}
- fStream := (fFormatContext^.streams + fStreamIndex)^;
+ fStream := PPAVStream(PtrUInt(fFormatContext^.streams) + fStreamIndex * Sizeof(pointer))^;
{$IFEND}
fCodecContext := fStream^.codec;