From 244eb73d55e4f1eb85d1f8bcf8f12542d0e57537 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Wed, 1 Nov 2017 18:31:29 +0100
Subject: [PATCH] lavc/pcm-dvd: Do not use an incompatible pointer on
big-endian.
Fixes the following gcc warning:
libavcodec/pcm-dvd.c:166:37: warning: passing argument 2 of 'bytestream2_get_buffer' from incompatible pointer type
---
libavcodec/pcm-dvd.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
@@ -153,7 +153,6 @@ static void *pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src,
void *dst, int blocks)
{
PCMDVDContext *s = avctx->priv_data;
- int16_t *dst16 = dst;
int32_t *dst32 = dst;
GetByteContext gb;
int i;
@@ -163,15 +162,17 @@ static void *pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src,
switch (avctx->bits_per_coded_sample) {
case 16: {
#if HAVE_BIGENDIAN
- bytestream2_get_buffer(&gb, dst16, blocks * s->block_size);
- dst16 += blocks * s->block_size / 2;
+ int8_t *dst8 = dst;
+ bytestream2_get_buffer(&gb, dst8, blocks * s->block_size);
+ return dst8 + blocks * s->block_size;
#else
int samples = blocks * avctx->channels;
+ int16_t *dst16 = dst;
do {
*dst16++ = bytestream2_get_be16u(&gb);
} while (--samples);
-#endif
return dst16;
+#endif
}
case 20:
if (avctx->channels == 1) {
--
1.7.10.4