aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-01-27 15:05:58 +0100
committerAnton Khirnov <anton@khirnov.net>2023-02-09 15:24:15 +0100
commit868a31b42dc0fb62f63e704138f083d48f40d68c (patch)
tree685d86b950257c3a984d3792437a22a9e4d4a8b9 /libavcodec
parent0281e28c3763765be1bff448bb735bbefca4c7d6 (diff)
downloadffmpeg-868a31b42dc0fb62f63e704138f083d48f40d68c.tar.gz
avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket*
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h3
-rw-r--r--libavcodec/decode.c9
2 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 755e543fac..e8333a94f1 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2615,8 +2615,7 @@ enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos);
* @param[in] avpkt The input AVPacket containing the input buffer.
*/
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- AVPacket *avpkt);
+ int *got_sub_ptr, const AVPacket *avpkt);
/**
* Supply raw packet data as input to a decoder.
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 03ae27ecdf..78bf3ba547 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -780,8 +780,8 @@ static void get_subtitle_defaults(AVSubtitle *sub)
}
#define UTF8_MAX_BYTES 4 /* 5 and 6 bytes sequences should not be used */
-static int recode_subtitle(AVCodecContext *avctx, AVPacket **outpkt,
- AVPacket *inpkt, AVPacket *buf_pkt)
+static int recode_subtitle(AVCodecContext *avctx, const AVPacket **outpkt,
+ const AVPacket *inpkt, AVPacket *buf_pkt)
{
#if CONFIG_ICONV
iconv_t cd = (iconv_t)-1;
@@ -861,8 +861,7 @@ static int utf8_check(const uint8_t *str)
}
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- AVPacket *avpkt)
+ int *got_sub_ptr, const AVPacket *avpkt)
{
int ret = 0;
@@ -882,7 +881,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size) {
AVCodecInternal *avci = avctx->internal;
- AVPacket *pkt;
+ const AVPacket *pkt;
ret = recode_subtitle(avctx, &pkt, avpkt, avci->buffer_pkt);
if (ret < 0)