summaryrefslogtreecommitdiffstats
path: root/libavcodec/libvorbisenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-07 11:23:29 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-07 11:28:38 +0200
commit79d30321a29dc648d5a475ce5086b2760d5d8c12 (patch)
treec712b09b56a0937ca08a1c89365addd8e4e33d4b /libavcodec/libvorbisenc.c
parent537ef8bebf8a35aab448db6ec876e275a10f0f15 (diff)
parent31b2262dca9cc77709d20c45610ec8030e7f9257 (diff)
downloadffmpeg-streaming-79d30321a29dc648d5a475ce5086b2760d5d8c12.zip
ffmpeg-streaming-79d30321a29dc648d5a475ce5086b2760d5d8c12.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: wmaenc: use float planar sample format (e)ac3enc: use planar sample format aacenc: use planar sample format adpcmenc: use planar sample format for adpcm_ima_wav and adpcm_ima_qt adpcmenc: move 'ch' variable to higher scope adpcmenc: fix 3 instances of variable shadowing adpcm_ima_wav: simplify encoding libvorbis: use planar sample format libmp3lame: use planar sample formats vorbisenc: use float planar sample format ffm: do not write or read the audio sample format parseutils: fix parsing of invalid alpha values doc/RELEASE_NOTES: update for the 9 release. smoothstreamingenc: Add a more verbose error message smoothstreamingenc: Ignore the return value from mkdir smoothstreamingenc: Try writing a manifest when opening the muxer smoothstreamingenc: Move the output_chunk_list and write_manifest functions up smoothstreamingenc: Properly return errors from ism_flush to the caller smoothstreamingenc: Check the output UrlContext before accessing it Conflicts: doc/RELEASE_NOTES libavcodec/aacenc.c libavcodec/ac3enc_template.c libavcodec/wmaenc.c tests/ref/lavf/ffm Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libvorbisenc.c')
-rw-r--r--libavcodec/libvorbisenc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/libvorbisenc.c b/libavcodec/libvorbisenc.c
index b042e0c..6064dd5 100644
--- a/libavcodec/libvorbisenc.c
+++ b/libavcodec/libvorbisenc.c
@@ -290,18 +290,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");
@@ -383,7 +381,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"),
.priv_class = &class,
OpenPOWER on IntegriCloud