X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibfaac.c;h=7ee1f3c3fa488533f7bb450529786520c88f7b59;hb=1d3c672d27d3beece88485e28f2286ec2df62e6e;hp=b220b1714e4559818043788a53bb8b2b3334dff3;hpb=5d6e4c160a4a0d71c17e8428123027c747ff0fb3;p=ffmpeg diff --git a/libavcodec/libfaac.c b/libavcodec/libfaac.c index b220b1714e4..7ee1f3c3fa4 100644 --- a/libavcodec/libfaac.c +++ b/libavcodec/libfaac.c @@ -2,20 +2,20 @@ * Interface to libfaac for aac encoding * Copyright (c) 2002 Gildas Bazin * - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav 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. * - * FFmpeg is distributed in the hope that it will be useful, + * Libav 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 FFmpeg; if not, write to the Free Software + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -124,10 +124,11 @@ static int Faac_encode_frame(AVCodecContext *avctx, { FaacAudioContext *s = avctx->priv_data; int bytes_written; + int num_samples = data ? avctx->frame_size : 0; bytes_written = faacEncEncode(s->faac_handle, data, - avctx->frame_size * avctx->channels, + num_samples * avctx->channels, frame, buf_size); @@ -145,14 +146,24 @@ static av_cold int Faac_encode_close(AVCodecContext *avctx) return 0; } -AVCodec libfaac_encoder = { - "libfaac", - AVMEDIA_TYPE_AUDIO, - CODEC_ID_AAC, - sizeof(FaacAudioContext), - Faac_encode_init, - Faac_encode_frame, - Faac_encode_close, +static const AVProfile profiles[] = { + { FF_PROFILE_AAC_MAIN, "Main" }, + { FF_PROFILE_AAC_LOW, "LC" }, + { FF_PROFILE_AAC_SSR, "SSR" }, + { FF_PROFILE_AAC_LTP, "LTP" }, + { FF_PROFILE_UNKNOWN }, +}; + +AVCodec ff_libfaac_encoder = { + .name = "libfaac", + .type = AVMEDIA_TYPE_AUDIO, + .id = CODEC_ID_AAC, + .priv_data_size = sizeof(FaacAudioContext), + .init = Faac_encode_init, + .encode = Faac_encode_frame, + .close = Faac_encode_close, + .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY, .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"), + .profiles = NULL_IF_CONFIG_SMALL(profiles), };