You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
pcm: fix decoding of pcm_s16le_planar on big-endian
The sample count is decremented by the DECODE() macro and needs to be reset in each loop iteration. Also, DECODE() increments the src pointer so that does not need to be done separately.
This commit is contained in:
@ -338,15 +338,17 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
break;
|
break;
|
||||||
case AV_CODEC_ID_PCM_S16LE_PLANAR:
|
case AV_CODEC_ID_PCM_S16LE_PLANAR:
|
||||||
{
|
{
|
||||||
|
int av_unused n2;
|
||||||
n /= avctx->channels;
|
n /= avctx->channels;
|
||||||
for (c = 0; c < avctx->channels; c++) {
|
for (c = 0; c < avctx->channels; c++) {
|
||||||
samples = s->frame.extended_data[c];
|
samples = s->frame.extended_data[c];
|
||||||
#if HAVE_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
DECODE(16, le16, src, samples, n, 0, 0)
|
n2 = n;
|
||||||
|
DECODE(16, le16, src, samples, n2, 0, 0)
|
||||||
#else
|
#else
|
||||||
memcpy(samples, src, n * 2);
|
memcpy(samples, src, n * 2);
|
||||||
#endif
|
|
||||||
src += n * 2;
|
src += n * 2;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user