From 3bd16ab2446bd2450bdbf4d333846a9c7ae45c6c Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Wed, 1 Nov 2017 17:10:12 +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 | 5 +++--
1 file changed, 3 insertions(+), 2 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,10 +162,12 @@ static void *pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src,
switch (avctx->bits_per_coded_sample) {
case 16: {
#if HAVE_BIGENDIAN
+ int8_t *dst16 = dst;
bytestream2_get_buffer(&gb, dst16, blocks * s->block_size);
- dst16 += blocks * s->block_size / 2;
+ dst16 += blocks * s->block_size;
#else
int samples = blocks * avctx->channels;
+ int16_t *dst16 = dst;
do {
*dst16++ = bytestream2_get_be16u(&gb);
} while (--samples);
--
1.7.10.4