summaryrefslogtreecommitdiff
path: root/libavformat/spdifenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-07-04 18:08:14 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-07-09 19:37:53 +0200
commitd5a0eba8a2481711e708442bcc1d14bf16e9d20b (patch)
tree56a13a62e6bd34e5a446f7d7a45dcc3ee6d246ba /libavformat/spdifenc.c
parent417554bdd6da58ec473096494618a22f7ac49b11 (diff)
av(format|device): Add const to muxer packet data pointers
The packets given to muxers need not be writable, so it is best to access them via const uint8_t*. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/spdifenc.c')
-rw-r--r--libavformat/spdifenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c
index 0a634e4232..7b8e231cff 100644
--- a/libavformat/spdifenc.c
+++ b/libavformat/spdifenc.c
@@ -63,7 +63,7 @@ typedef struct IEC61937Context {
uint8_t *buffer; ///< allocated buffer, used for swap bytes
int buffer_size; ///< size of allocated buffer
- uint8_t *out_buf; ///< pointer to the outgoing data before byte-swapping
+ const uint8_t *out_buf; ///< pointer to the outgoing data before byte-swapping
int out_bytes; ///< amount of outgoing bytes
int use_preamble; ///< preamble enabled (disabled for exactly pre-padded DTS)
@@ -657,7 +657,7 @@ static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt)
av_fast_malloc(&ctx->buffer, &ctx->buffer_size, ctx->out_bytes + AV_INPUT_BUFFER_PADDING_SIZE);
if (!ctx->buffer)
return AVERROR(ENOMEM);
- ff_spdif_bswap_buf16((uint16_t *)ctx->buffer, (uint16_t *)ctx->out_buf, ctx->out_bytes >> 1);
+ ff_spdif_bswap_buf16((uint16_t *)ctx->buffer, (const uint16_t *)ctx->out_buf, ctx->out_bytes >> 1);
avio_write(s->pb, ctx->buffer, ctx->out_bytes & ~1);
}