diff mbox series

[FFmpeg-devel,1/3] lavfi/metal: fix mixing declarations and code warning

Message ID 20230403122518.1132660-1-mypopydev@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/3] lavfi/metal: fix mixing declarations and code warning | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Jun Zhao April 3, 2023, 12:25 p.m. UTC
fix mixing declarations and code warning

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 libavfilter/vf_yadif_videotoolbox.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Zhao Zhili April 3, 2023, 1:29 p.m. UTC | #1
> On Apr 3, 2023, at 20:25, Jun Zhao <mypopydev@gmail.com> wrote:
> 
> fix mixing declarations and code warning
> 
> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> ---
> libavfilter/vf_yadif_videotoolbox.m | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

I have noticed the -Wdeclaration-after-statement flag has been applied
on Objective-C, but I’m not sure whether the rule should applies or not.

> 
> diff --git a/libavfilter/vf_yadif_videotoolbox.m b/libavfilter/vf_yadif_videotoolbox.m
> index 69186c2254..3656a673b3 100644
> --- a/libavfilter/vf_yadif_videotoolbox.m
> +++ b/libavfilter/vf_yadif_videotoolbox.m
> @@ -208,6 +208,7 @@ static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
>     YADIFVTContext *s = ctx->priv;
>     NSError *err = nil;
>     CVReturn ret;
> +    dispatch_data_t libData;
> 
>     s->mtlDevice = MTLCreateSystemDefaultDevice();
>     if (!s->mtlDevice) {
> @@ -217,7 +218,7 @@ static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
> 
>     av_log(ctx, AV_LOG_INFO, "Using Metal device: %s\n", s->mtlDevice.name.UTF8String);
> 
> -    dispatch_data_t libData = dispatch_data_create(
> +    libData = dispatch_data_create(
>         ff_vf_yadif_videotoolbox_metallib_data,
>         ff_vf_yadif_videotoolbox_metallib_len,
>         nil,
> -- 
> 2.25.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
mypopy@gmail.com April 8, 2023, 12:17 p.m. UTC | #2
On Mon, Apr 3, 2023 at 9:29 PM "zhilizhao(赵志立)" <quinkblack@foxmail.com> wrote:
>
>
>
> > On Apr 3, 2023, at 20:25, Jun Zhao <mypopydev@gmail.com> wrote:
> >
> > fix mixing declarations and code warning
> >
> > Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> > ---
> > libavfilter/vf_yadif_videotoolbox.m | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
>
> I have noticed the -Wdeclaration-after-statement flag has been applied
> on Objective-C, but I’m not sure whether the rule should applies or not.
>
I will hold on the Objective-C part and push the other patches in the patch sets
> >
> > diff --git a/libavfilter/vf_yadif_videotoolbox.m b/libavfilter/vf_yadif_videotoolbox.m
> > index 69186c2254..3656a673b3 100644
> > --- a/libavfilter/vf_yadif_videotoolbox.m
> > +++ b/libavfilter/vf_yadif_videotoolbox.m
> > @@ -208,6 +208,7 @@ static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
> >     YADIFVTContext *s = ctx->priv;
> >     NSError *err = nil;
> >     CVReturn ret;
> > +    dispatch_data_t libData;
> >
> >     s->mtlDevice = MTLCreateSystemDefaultDevice();
> >     if (!s->mtlDevice) {
> > @@ -217,7 +218,7 @@ static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
> >
> >     av_log(ctx, AV_LOG_INFO, "Using Metal device: %s\n", s->mtlDevice.name.UTF8String);
> >
> > -    dispatch_data_t libData = dispatch_data_create(
> > +    libData = dispatch_data_create(
> >         ff_vf_yadif_videotoolbox_metallib_data,
> >         ff_vf_yadif_videotoolbox_metallib_len,
> >         nil,
> > --
> > 2.25.1
diff mbox series

Patch

diff --git a/libavfilter/vf_yadif_videotoolbox.m b/libavfilter/vf_yadif_videotoolbox.m
index 69186c2254..3656a673b3 100644
--- a/libavfilter/vf_yadif_videotoolbox.m
+++ b/libavfilter/vf_yadif_videotoolbox.m
@@ -208,6 +208,7 @@  static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
     YADIFVTContext *s = ctx->priv;
     NSError *err = nil;
     CVReturn ret;
+    dispatch_data_t libData;
 
     s->mtlDevice = MTLCreateSystemDefaultDevice();
     if (!s->mtlDevice) {
@@ -217,7 +218,7 @@  static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
 
     av_log(ctx, AV_LOG_INFO, "Using Metal device: %s\n", s->mtlDevice.name.UTF8String);
 
-    dispatch_data_t libData = dispatch_data_create(
+    libData = dispatch_data_create(
         ff_vf_yadif_videotoolbox_metallib_data,
         ff_vf_yadif_videotoolbox_metallib_len,
         nil,