summaryrefslogtreecommitdiffstats
path: root/libavcodec/vorbisenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/vorbisenc.c')
-rw-r--r--libavcodec/vorbisenc.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c
index 42713f9..33b2577 100644
--- a/libavcodec/vorbisenc.c
+++ b/libavcodec/vorbisenc.c
@@ -1,20 +1,20 @@
/*
* copyright (c) 2006 Oded Shimon <ods15@ods15.dyndns.org>
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -1014,7 +1014,6 @@ static int apply_window_and_mdct(vorbis_enc_context *venc,
return 1;
}
-
static int vorbis_encode_frame(AVCodecContext *avccontext, AVPacket *avpkt,
const AVFrame *frame, int *got_packet_ptr)
{
@@ -1030,10 +1029,8 @@ static int vorbis_encode_frame(AVCodecContext *avccontext, AVPacket *avpkt,
return 0;
samples = 1 << (venc->log2_blocksize[0] - 1);
- if ((ret = ff_alloc_packet(avpkt, 8192))) {
- av_log(avccontext, AV_LOG_ERROR, "Error getting output packet\n");
+ if ((ret = ff_alloc_packet2(avccontext, avpkt, 8192)))
return ret;
- }
init_put_bits(&pb, avpkt->data, avpkt->size);
@@ -1090,10 +1087,10 @@ static int vorbis_encode_frame(AVCodecContext *avccontext, AVPacket *avpkt,
avpkt->size = put_bits_count(&pb) >> 3;
avpkt->duration = ff_samples_to_time_base(avccontext, avccontext->frame_size);
- if (frame)
+ if (frame) {
if (frame->pts != AV_NOPTS_VALUE)
avpkt->pts = ff_samples_to_time_base(avccontext, frame->pts);
- else
+ } else
avpkt->pts = venc->next_pts;
if (avpkt->pts != AV_NOPTS_VALUE)
venc->next_pts = avpkt->pts + avpkt->duration;
@@ -1171,7 +1168,7 @@ static av_cold int vorbis_encode_init(AVCodecContext *avccontext)
int ret;
if (avccontext->channels != 2) {
- av_log(avccontext, AV_LOG_ERROR, "Current Libav Vorbis encoder only supports 2 channels.\n");
+ av_log(avccontext, AV_LOG_ERROR, "Current FFmpeg Vorbis encoder only supports 2 channels.\n");
return -1;
}
@@ -1182,7 +1179,7 @@ static av_cold int vorbis_encode_init(AVCodecContext *avccontext)
if (avccontext->flags & CODEC_FLAG_QSCALE)
venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA;
else
- venc->quality = 3.0;
+ venc->quality = 8;
venc->quality *= venc->quality;
if ((ret = put_main_header(venc, (uint8_t**)&avccontext->extradata)) < 0)
OpenPOWER on IntegriCloud