aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libvorbis.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-08-23 13:47:09 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-10-06 12:25:32 -0400
commitcfc0a80a1da76b8c25c09c0877b5c2530f5c322c (patch)
tree59efd06711e5c18cfca6a37fba87706bf8e9caa3 /libavcodec/libvorbis.c
parent473b297f26b51a5d6bf4cd0126d950cc4b105bd7 (diff)
downloadffmpeg-cfc0a80a1da76b8c25c09c0877b5c2530f5c322c.tar.gz
libvorbis: use planar sample format
Diffstat (limited to 'libavcodec/libvorbis.c')
-rw-r--r--libavcodec/libvorbis.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/libvorbis.c b/libavcodec/libvorbis.c
index ef87cd77d0..a31d476c74 100644
--- a/libavcodec/libvorbis.c
+++ b/libavcodec/libvorbis.c
@@ -264,18 +264,16 @@ static int oggvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
/* send samples to libvorbis */
if (frame) {
- const float *audio = (const float *)frame->data[0];
const int samples = frame->nb_samples;
float **buffer;
int c, channels = s->vi.channels;
buffer = vorbis_analysis_buffer(&s->vd, samples);
for (c = 0; c < channels; c++) {
- int i;
int co = (channels > 8) ? c :
ff_vorbis_encoding_channel_layout_offsets[channels - 1][c];
- for (i = 0; i < samples; i++)
- buffer[c][i] = audio[i * channels + co];
+ memcpy(buffer[c], frame->extended_data[co],
+ samples * sizeof(*buffer[c]));
}
if ((ret = vorbis_analysis_wrote(&s->vd, samples)) < 0) {
av_log(avctx, AV_LOG_ERROR, "error in vorbis_analysis_wrote()\n");
@@ -357,7 +355,7 @@ AVCodec ff_libvorbis_encoder = {
.encode2 = oggvorbis_encode_frame,
.close = oggvorbis_encode_close,
.capabilities = CODEC_CAP_DELAY,
- .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT,
+ .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
.priv_class = &class,