[FFmpeg-cvslog] avformat/serdec: fix BE/LE format handling

Paul B Mahol git at videolan.org
Thu Nov 3 17:56:23 EET 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Nov  3 16:57:07 2022 +0100| [e27bef9a56991b6c74e1a38b3035d53dffdc9cf1] | committer: Paul B Mahol

avformat/serdec: fix BE/LE format handling

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e27bef9a56991b6c74e1a38b3035d53dffdc9cf1
---

 libavformat/serdec.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavformat/serdec.c b/libavformat/serdec.c
index fe185cabd9..11add35b32 100644
--- a/libavformat/serdec.c
+++ b/libavformat/serdec.c
@@ -68,13 +68,13 @@ static int ser_read_header(AVFormatContext *s)
     avio_skip(s->pb, 8);
 
     switch (color_id) {
-    case   0: pix_fmt = depth <= 8 ? AV_PIX_FMT_GRAY8       : endian ? AV_PIX_FMT_GRAY16LE       : AV_PIX_FMT_GRAY16BE;       break;
-    case   8: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_RGGB8 : endian ? AV_PIX_FMT_BAYER_RGGB16LE : AV_PIX_FMT_BAYER_RGGB16BE; break;
-    case   9: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_GRBG8 : endian ? AV_PIX_FMT_BAYER_GRBG16LE : AV_PIX_FMT_BAYER_GRBG16BE; break;
-    case  10: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_GBRG8 : endian ? AV_PIX_FMT_BAYER_GBRG16LE : AV_PIX_FMT_BAYER_GBRG16BE; break;
-    case  11: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_BGGR8 : endian ? AV_PIX_FMT_BAYER_BGGR16LE : AV_PIX_FMT_BAYER_BGGR16BE; break;
-    case 100: pix_fmt = depth <= 8 ? AV_PIX_FMT_RGB24       : endian ? AV_PIX_FMT_RGB48LE        : AV_PIX_FMT_RGB48BE;        break;
-    case 101: pix_fmt = depth <= 8 ? AV_PIX_FMT_BGR24       : endian ? AV_PIX_FMT_BGR48LE        : AV_PIX_FMT_BGR48BE;        break;
+    case   0: pix_fmt = depth <= 8 ? AV_PIX_FMT_GRAY8       : endian ? AV_PIX_FMT_GRAY16BE       : AV_PIX_FMT_GRAY16LE;       break;
+    case   8: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_RGGB8 : endian ? AV_PIX_FMT_BAYER_RGGB16BE : AV_PIX_FMT_BAYER_RGGB16LE; break;
+    case   9: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_GRBG8 : endian ? AV_PIX_FMT_BAYER_GRBG16BE : AV_PIX_FMT_BAYER_GRBG16LE; break;
+    case  10: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_GBRG8 : endian ? AV_PIX_FMT_BAYER_GBRG16BE : AV_PIX_FMT_BAYER_GBRG16LE; break;
+    case  11: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_BGGR8 : endian ? AV_PIX_FMT_BAYER_BGGR16BE : AV_PIX_FMT_BAYER_BGGR16LE; break;
+    case 100: pix_fmt = depth <= 8 ? AV_PIX_FMT_RGB24       : endian ? AV_PIX_FMT_RGB48BE        : AV_PIX_FMT_RGB48LE;        break;
+    case 101: pix_fmt = depth <= 8 ? AV_PIX_FMT_BGR24       : endian ? AV_PIX_FMT_BGR48BE        : AV_PIX_FMT_BGR48LE;        break;
     default:
         return AVERROR_PATCHWELCOME;
     }



More information about the ffmpeg-cvslog mailing list