diff mbox series

[FFmpeg-devel,2/8] avformat/argo_brp: set pixel format directly

Message ID 20210718012204.97733-2-zane@zanevaniperen.com
State New
Headers show
Series [FFmpeg-devel,1/8] avcodec/argo: use pixel format provided by the demuxer
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Zane van Iperen July 18, 2021, 1:21 a.m. UTC
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
 libavformat/argo_brp.c | 11 ++++++++++-
 libavformat/version.h  |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/argo_brp.c b/libavformat/argo_brp.c
index 059418cd1d..6cc0c4a3f8 100644
--- a/libavformat/argo_brp.c
+++ b/libavformat/argo_brp.c
@@ -230,7 +230,16 @@  static int argo_brp_read_header(AVFormatContext *s)
             st->codecpar->width  = bvid->width;
             st->codecpar->height = bvid->height;
             st->nb_frames = bvid->num_frames;
-            st->codecpar->bits_per_raw_sample = bvid->depth;
+
+            if (bvid->depth == 8) {
+                st->codecpar->format = AV_PIX_FMT_PAL8;
+            } else if (bvid->depth == 24) {
+                st->codecpar->format = AV_PIX_FMT_BGR0;
+            } else {
+                st->codecpar->format = AV_PIX_FMT_NONE;
+                avpriv_request_sample(s, "depth == %u", bvid->depth);
+            }
+
         } else if (hdr->codec_id == BRP_CODEC_ID_BASF) {
             /*
              * It would make the demuxer significantly more complicated
diff --git a/libavformat/version.h b/libavformat/version.h
index 6519bba101..03eb20ad82 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -33,7 +33,7 @@ 
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  59
 #define LIBAVFORMAT_VERSION_MINOR   4
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \