diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-11-20 00:57:41 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-11-20 10:52:49 -0500 |
commit | 00dd9a6d6a5c3cc209082023595354a81aff9bb9 (patch) | |
tree | 6ed84f91c6f54dd9f46d88a3384c55b85e1f175b /libavcodec/pcm.c | |
parent | ae3822bca16f1cdb2460a35b16f8ef636a04314e (diff) | |
download | ffmpeg-00dd9a6d6a5c3cc209082023595354a81aff9bb9.tar.gz |
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.
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r-- | libavcodec/pcm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index 906e8e83aa..a24a38ba80 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -338,15 +338,17 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, break; case AV_CODEC_ID_PCM_S16LE_PLANAR: { + int av_unused n2; n /= avctx->channels; for (c = 0; c < avctx->channels; c++) { samples = s->frame.extended_data[c]; #if HAVE_BIGENDIAN - DECODE(16, le16, src, samples, n, 0, 0) + n2 = n; + DECODE(16, le16, src, samples, n2, 0, 0) #else memcpy(samples, src, n * 2); -#endif src += n * 2; +#endif } break; } |