[FFmpeg-devel] [PATCH 13/24] sws: reset sliceDir at the end of sws_scale()

Anton Khirnov anton at khirnov.net
Mon May 31 10:55:04 EEST 2021


Makes it more clear that resetting it does not interact with the scaling
code that it is currently intermixed with.
---
 libswscale/swscale.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 4b577ef263..cc3700c704 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -983,10 +983,6 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
     reset_ptr(src2, c->srcFormat);
     reset_ptr((void*)dst2, c->dstFormat);
 
-    /* reset slice direction at end of frame */
-    if (srcSliceY_internal + srcSliceH == c->srcH)
-        c->sliceDir = 0;
-
     if (c->swscale)
         ret = c->swscale(c, src2, srcStride2, srcSliceY_internal, srcSliceH, dst2, dstStride2);
     else
@@ -1003,5 +999,9 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
         rgb48Toxyz12(c, dst16, dst16, dstStride2[0]/2, ret);
     }
 
+    /* reset slice direction at end of frame */
+    if (srcSliceY_internal + srcSliceH == c->srcH)
+        c->sliceDir = 0;
+
     return ret;
 }
-- 
2.30.2



More information about the ffmpeg-devel mailing list