diff options
Diffstat (limited to 'libavcodec/v410enc.c')
-rw-r--r-- | libavcodec/v410enc.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c index 1e3f38fd71..5e2450279f 100644 --- a/libavcodec/v410enc.c +++ b/libavcodec/v410enc.c @@ -3,20 +3,20 @@ * * Copyright (c) 2011 Derek Buitenhuis * - * 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 */ @@ -28,10 +28,13 @@ static av_cold int v410_encode_init(AVCodecContext *avctx) { if (avctx->width & 1) { - av_log(avctx, AV_LOG_ERROR, "v410 requires even width.\n"); + av_log(avctx, AV_LOG_ERROR, "v410 requires width to be even.\n"); return AVERROR_INVALIDDATA; } + avctx->bits_per_coded_sample = 32; + avctx->bit_rate = ff_guess_coded_bitrate(avctx); + return 0; } @@ -43,10 +46,9 @@ static int v410_encode_frame(AVCodecContext *avctx, AVPacket *pkt, uint32_t val; int i, j, ret; - if ((ret = ff_alloc_packet(pkt, avctx->width * avctx->height * 4)) < 0) { - av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n"); + if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 4, + avctx->width * avctx->height * 4)) < 0) return ret; - } dst = pkt->data; #if FF_API_CODED_FRAME |