diff mbox

[FFmpeg-devel] sdl2: map AV_PIX_FMT_NONE to SDL_PIXELFORMAT_UNKNOWN

Message ID 71cb00a8-ffea-fe3d-211b-bae983fea4ed@gmail.com
State New
Headers show

Commit Message

Alfred E. Heggestad Oct. 30, 2019, 11:39 a.m. UTC
---
From 6331f77ca00acdaaee0db6b0d2d04fff9f1c70c9 Mon Sep 17 00:00:00 2001
From: "Alfred E. Heggestad" <alfred.heggestad@gmail.com>
Date: Wed, 30 Oct 2019 12:30:49 +0100
Subject: [PATCH] sdl2: map AV_PIX_FMT_NONE to SDL_PIXELFORMAT_UNKNOWN

This does not change the programs behaviour.
The purpose of this patch is to make the code more
robust against future changes, in case someone
starts using the AV_PIX_FMT_NONE entry.

Signed-off-by: Alfred E. Heggestad <alfred.heggestad@gmail.com>
---
 libavdevice/sdl2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marton Balint Nov. 1, 2019, 5:42 p.m. UTC | #1
On Wed, 30 Oct 2019, Alfred E. Heggestad wrote:

> This does not change the programs behaviour.
> The purpose of this patch is to make the code more
> robust against future changes, in case someone
> starts using the AV_PIX_FMT_NONE entry.

PIX_FMT_NONE signals the end of the array, whatever it maps to is 
irrelevent. I'd rather keep code as is.

Regards,
Marton
diff mbox

Patch

diff --git a/libavdevice/sdl2.c b/libavdevice/sdl2.c
index d6fc74a66c..4eafde10de 100644
--- a/libavdevice/sdl2.c
+++ b/libavdevice/sdl2.c
@@ -91,7 +91,7 @@  static const struct sdl_texture_format_entry {
     { AV_PIX_FMT_YUV420P, SDL_PIXELFORMAT_IYUV },
     { AV_PIX_FMT_YUYV422, SDL_PIXELFORMAT_YUY2 },
     { AV_PIX_FMT_UYVY422, SDL_PIXELFORMAT_UYVY },
-    { AV_PIX_FMT_NONE,    0                },
+    { AV_PIX_FMT_NONE,    SDL_PIXELFORMAT_UNKNOWN },
 };
 
 static void compute_texture_rect(AVFormatContext *s)