]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cbs: constify decompose_unit_types
authorJames Almer <jamrial@gmail.com>
Sun, 10 Jan 2021 22:22:59 +0000 (19:22 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 10 Jan 2021 22:23:07 +0000 (19:23 -0300)
CBS doesn't change its contents in any way whatsoever internally, and most
users already set it to a const array.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/av1_frame_split_bsf.c
libavcodec/av1_parser.c
libavcodec/cbs.h

index 13bebe19f5a06672bf1396e548e8c5bb0817799f..fa8b887b6c51a82191bef73b0cd3925727664a3b 100644 (file)
@@ -214,7 +214,7 @@ static int av1_frame_split_init(AVBSFContext *ctx)
     if (ret < 0)
         return ret;
 
-    s->cbc->decompose_unit_types    = (CodedBitstreamUnitType*)decompose_unit_types;
+    s->cbc->decompose_unit_types    = decompose_unit_types;
     s->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(decompose_unit_types);
 
     if (!ctx->par_in->extradata_size)
index 181ff3a1be789f9ae14fa14529cb0c10dd6c457d..6a76ffb7bc35a1ae9ce1148bce9f4f85cf2a48dd 100644 (file)
@@ -191,7 +191,7 @@ static av_cold int av1_parser_init(AVCodecParserContext *ctx)
     if (ret < 0)
         return ret;
 
-    s->cbc->decompose_unit_types    = (CodedBitstreamUnitType *)decompose_unit_types;
+    s->cbc->decompose_unit_types    = decompose_unit_types;
     s->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(decompose_unit_types);
 
     return 0;
index 3fd0a0ef3318d5125d3e752d53b3cdea3e21e440..f022282b75b1f5c7d0ab9fecb3b7f57f19a21278 100644 (file)
@@ -196,7 +196,7 @@ typedef struct CodedBitstreamContext {
      * Types not in this list will be available in bitstream form only.
      * If NULL, all supported types will be decomposed.
      */
-    CodedBitstreamUnitType *decompose_unit_types;
+    const CodedBitstreamUnitType *decompose_unit_types;
     /**
      * Length of the decompose_unit_types array.
      */