Fix a "mixing declarations and code is incompatible with standards
before C99" warning.
---
 libavfilter/metal/utils.m | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavfilter/metal/utils.m b/libavfilter/metal/utils.m
index f365d3ceea..d5c85e619d 100644
--- a/libavfilter/metal/utils.m
+++ b/libavfilter/metal/utils.m
@@ -24,11 +24,15 @@ void ff_metal_compute_encoder_dispatch(id<MTLDevice> device,
                                        id<MTLComputeCommandEncoder> encoder,
                                        NSUInteger width, NSUInteger height)
 {
-    [encoder setComputePipelineState:pipeline];
-    NSUInteger w = pipeline.threadExecutionWidth;
-    NSUInteger h = pipeline.maxTotalThreadsPerThreadgroup / w;
-    MTLSize threadsPerThreadgroup = MTLSizeMake(w, h, 1);
     BOOL fallback = YES;
+    MTLSize threadsPerThreadgroup;
+    NSUInteger w, h;
+
+    [encoder setComputePipelineState:pipeline];
+    w = pipeline.threadExecutionWidth;
+    h = pipeline.maxTotalThreadsPerThreadgroup / w;
+    threadsPerThreadgroup = MTLSizeMake(w, h, 1);
+
     // MAC_OS_X_VERSION_10_15 is only defined on SDKs new enough to include 
its functionality (including iOS, tvOS, etc)
 #ifdef MAC_OS_X_VERSION_10_15
     if (@available(macOS 10.15, iOS 11, tvOS 14.5, *)) {
-- 
2.39.3 (Apple Git-146)


_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to