From 977eb7d567f6e3f7562a2c5682d346372ba105b4 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 28 Aug 2012 14:02:41 -0400 Subject: shorten: use planar sample format --- libavcodec/shorten.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'libavcodec/shorten.c') diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index fb48070eb6..1664a907ae 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -112,7 +112,7 @@ static av_cold int shorten_decode_init(AVCodecContext * avctx) { ShortenContext *s = avctx->priv_data; s->avctx = avctx; - avctx->sample_fmt = AV_SAMPLE_FMT_S16; + avctx->sample_fmt = AV_SAMPLE_FMT_S16P; avcodec_get_frame_defaults(&s->frame); avctx->coded_frame = &s->frame; @@ -259,13 +259,16 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header, return 0; } -static void interleave_buffer(int16_t *samples, int nchan, int blocksize, - int32_t **buffer) +static void output_buffer(int16_t **samples, int nchan, int blocksize, + int32_t **buffer) { - int i, chan; - for (i=0; iframe.data[0], s->channels, - s->blocksize, s->decoded); + output_buffer((int16_t **)s->frame.extended_data, s->channels, + s->blocksize, s->decoded); *got_frame_ptr = 1; *(AVFrame *)data = s->frame; @@ -637,4 +640,6 @@ AVCodec ff_shorten_decoder = { .decode = shorten_decode_frame, .capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("Shorten"), + .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + AV_SAMPLE_FMT_NONE }, }; -- cgit v1.2.3