aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/ffmpeg/swscale.pas3
-rw-r--r--src/media/UVideo.pas12
2 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas
index fb57296f..965659d9 100644
--- a/src/lib/ffmpeg/swscale.pas
+++ b/src/lib/ffmpeg/swscale.pas
@@ -152,7 +152,8 @@ type
procedure sws_freeContext(swsContext: PSwsContext);
cdecl; external sw__scale;
-function sws_getContext(srcW: cint; srcH: cint; srcFormat: cint; dstW: cint; dstH: cint; dstFormat: cint; flags: cint;
+function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat;
+ dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; flags: cint;
srcFilter: PSwsFilter; dstFilter: PSwsFilter; param: PCdouble): PSwsContext;
cdecl; external sw__scale;
function sws_scale(context: PSwsContext; src: PPCuint8Array; srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint;
diff --git a/src/media/UVideo.pas b/src/media/UVideo.pas
index 9f3fc6da..06577d9e 100644
--- a/src/media/UVideo.pas
+++ b/src/media/UVideo.pas
@@ -392,9 +392,9 @@ begin
// could be observed in comparison to the RGB versions.
fSwScaleContext := sws_getContext(
fCodecContext^.width, fCodecContext^.height,
- integer(fCodecContext^.pix_fmt),
+ fCodecContext^.pix_fmt,
fCodecContext^.width, fCodecContext^.height,
- integer(PIXEL_FMT_FFMPEG),
+ PIXEL_FMT_FFMPEG,
SWS_FAST_BILINEAR, nil, nil, nil);
if (fSwScaleContext = nil) then
begin
@@ -495,7 +495,7 @@ begin
// failed to read a frame, check reason
{$IF (LIBAVFORMAT_VERSION_MAJOR >= 52)}
- pbIOCtx := VideoFormatContext^.pb;
+ pbIOCtx := fFormatContext^.pb;
{$ELSE}
pbIOCtx := @fFormatContext^.pb;
{$IFEND}
@@ -670,9 +670,9 @@ begin
0, fCodecContext^.Height,
@(fAVFrameRGB.data), @(fAVFrameRGB.linesize));
{$ELSE}
- errnum := img_convert(PAVPicture(AVFrameRGB), PIXEL_FMT_FFMPEG,
- PAVPicture(AVFrame), VideoCodecContext^.pix_fmt,
- VideoCodecContext^.width, VideoCodecContext^.height);
+ errnum := img_convert(PAVPicture(fAVFrameRGB), PIXEL_FMT_FFMPEG,
+ PAVPicture(fAVFrame), fCodecContext^.pix_fmt,
+ fCodecContext^.width, fCodecContext^.height);
{$ENDIF}
if (errnum < 0) then