avcodec/pcm-bluray/dvd: Use correct pointer types on BE

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-03-28 05:35:36 +01:00
parent cd63dab55c
commit 347a70f101
2 changed files with 4 additions and 3 deletions

View File

@ -167,7 +167,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, AVFrame *frame,
samples *= num_source_channels; samples *= num_source_channels;
if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) { if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
#if HAVE_BIGENDIAN #if HAVE_BIGENDIAN
bytestream2_get_buffer(&gb, dst16, buf_size); bytestream2_get_buffer(&gb, (uint8_t*)dst16, buf_size);
#else #else
do { do {
*dst16++ = bytestream2_get_be16u(&gb); *dst16++ = bytestream2_get_be16u(&gb);
@ -187,7 +187,8 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, AVFrame *frame,
if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) { if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
do { do {
#if HAVE_BIGENDIAN #if HAVE_BIGENDIAN
bytestream2_get_buffer(&gb, dst16, avctx->ch_layout.nb_channels * 2); bytestream2_get_buffer(&gb, (uint8_t*)dst16,
avctx->ch_layout.nb_channels * 2);
dst16 += avctx->ch_layout.nb_channels; dst16 += avctx->ch_layout.nb_channels;
#else #else
channel = avctx->ch_layout.nb_channels; channel = avctx->ch_layout.nb_channels;

View File

@ -157,7 +157,7 @@ static void *pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src,
switch (avctx->bits_per_coded_sample) { switch (avctx->bits_per_coded_sample) {
case 16: { case 16: {
#if HAVE_BIGENDIAN #if HAVE_BIGENDIAN
bytestream2_get_buffer(&gb, dst16, blocks * s->block_size); bytestream2_get_buffer(&gb, (uint8_t*)dst16, blocks * s->block_size);
dst16 += blocks * s->block_size / 2; dst16 += blocks * s->block_size / 2;
#else #else
int samples = blocks * avctx->ch_layout.nb_channels; int samples = blocks * avctx->ch_layout.nb_channels;