diff mbox series

[FFmpeg-devel,2/2] avutil/hwcontext_videotoolbox: fix declaration-after-statement

Message ID tencent_AA95B56869AA007968067DAAADAA39C5C00A@qq.com
State New
Headers show
Series [FFmpeg-devel,1/2] avutil/hwcontext_videotoolbox: create real buffer pool | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished

Commit Message

Zhao Zhili March 10, 2022, 4:37 a.m. UTC
---
 libavutil/hwcontext_videotoolbox.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Zhao Zhili March 17, 2022, 3:35 a.m. UTC | #1
Feel free to drop this one, there is no real gain.

> On Mar 10, 2022, at 12:37 PM, Zhao Zhili <quinkblack@foxmail.com> wrote:
> 
> ---
> libavutil/hwcontext_videotoolbox.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c
> index e442a95007..13f77a7692 100644
> --- a/libavutil/hwcontext_videotoolbox.c
> +++ b/libavutil/hwcontext_videotoolbox.c
> @@ -161,11 +161,11 @@ uint32_t av_map_videotoolbox_format_from_pixfmt2(enum AVPixelFormat pix_fmt, boo
> 
> static int vt_pool_alloc(AVHWFramesContext *ctx)
> {
> -    VTFramesContext *fctx = ctx->internal->priv;
>     CVReturn err;
>     CFNumberRef w, h, pixfmt;
>     uint32_t cv_pixfmt;
>     CFMutableDictionaryRef attributes, iosurface_properties;
> +    VTFramesContext *fctx = ctx->internal->priv;
> 
>     attributes = CFDictionaryCreateMutable(
>         NULL,
> @@ -589,13 +589,13 @@ int av_vt_pixbuf_set_attachments(void *log_ctx,
> static int vt_map_frame(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src,
>                         int flags)
> {
> -    CVPixelBufferRef pixbuf = (CVPixelBufferRef)src->data[3];
> -    OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
>     CVReturn err;
> -    uint32_t map_flags = 0;
>     int ret;
>     int i;
>     enum AVPixelFormat format;
> +    CVPixelBufferRef pixbuf = (CVPixelBufferRef)src->data[3];
> +    OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
> +    uint32_t map_flags = 0;
> 
>     format = av_map_videotoolbox_format_to_pixfmt(pixel_format);
>     if (dst->format != format) {
> -- 
> 2.31.1
>
diff mbox series

Patch

diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c
index e442a95007..13f77a7692 100644
--- a/libavutil/hwcontext_videotoolbox.c
+++ b/libavutil/hwcontext_videotoolbox.c
@@ -161,11 +161,11 @@  uint32_t av_map_videotoolbox_format_from_pixfmt2(enum AVPixelFormat pix_fmt, boo
 
 static int vt_pool_alloc(AVHWFramesContext *ctx)
 {
-    VTFramesContext *fctx = ctx->internal->priv;
     CVReturn err;
     CFNumberRef w, h, pixfmt;
     uint32_t cv_pixfmt;
     CFMutableDictionaryRef attributes, iosurface_properties;
+    VTFramesContext *fctx = ctx->internal->priv;
 
     attributes = CFDictionaryCreateMutable(
         NULL,
@@ -589,13 +589,13 @@  int av_vt_pixbuf_set_attachments(void *log_ctx,
 static int vt_map_frame(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src,
                         int flags)
 {
-    CVPixelBufferRef pixbuf = (CVPixelBufferRef)src->data[3];
-    OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
     CVReturn err;
-    uint32_t map_flags = 0;
     int ret;
     int i;
     enum AVPixelFormat format;
+    CVPixelBufferRef pixbuf = (CVPixelBufferRef)src->data[3];
+    OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
+    uint32_t map_flags = 0;
 
     format = av_map_videotoolbox_format_to_pixfmt(pixel_format);
     if (dst->format != format) {