X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibspeexenc.c;h=f3a31e98798b204ac87a4158e2525db48d50965c;hb=e3e8eab359238486dc233f7aa89b7bb3cb19ec38;hp=651d7ace0b97bb8ff796adaadeef7947479bc2f7;hpb=b2bed9325dbd6be0da1d91ffed3f513c40274fd2;p=ffmpeg diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c index 651d7ace0b9..f3a31e98798 100644 --- a/libavcodec/libspeexenc.c +++ b/libavcodec/libspeexenc.c @@ -40,7 +40,7 @@ * used to set the encoding mode. * * Rate Control - * VBR mode is turned on by setting CODEC_FLAG_QSCALE in avctx->flags. + * VBR mode is turned on by setting AV_CODEC_FLAG_QSCALE in avctx->flags. * avctx->global_quality is used to set the encoding quality. * For CBR mode, avctx->bit_rate can be used to set the constant bitrate. * Alternatively, the 'cbr_quality' option can be set from 0 to 10 to set @@ -92,7 +92,7 @@ #include "internal.h" #include "audio_frame_queue.h" -typedef struct { +typedef struct LibSpeexEncContext { AVClass *class; ///< AVClass for private options SpeexBits bits; ///< libspeex bitwriter context SpeexHeader header; ///< libspeex header struct @@ -176,7 +176,7 @@ static av_cold int encode_init(AVCodecContext *avctx) speex_init_header(&s->header, avctx->sample_rate, avctx->channels, mode); /* rate control method and parameters */ - if (avctx->flags & CODEC_FLAG_QSCALE) { + if (avctx->flags & AV_CODEC_FLAG_QSCALE) { /* VBR */ s->header.vbr = 1; s->vad = 1; /* VAD is always implicitly activated for VBR */ @@ -215,7 +215,7 @@ static av_cold int encode_init(AVCodecContext *avctx) if (s->vad) speex_encoder_ctl(s->enc_state, SPEEX_SET_VAD, &s->vad); - /* Activiting Discontinuous Transmission */ + /* Activating Discontinuous Transmission */ if (s->dtx) { speex_encoder_ctl(s->enc_state, SPEEX_SET_DTX, &s->dtx); if (!(s->abr || s->vad || s->header.vbr)) @@ -235,7 +235,7 @@ static av_cold int encode_init(AVCodecContext *avctx) s->header.frames_per_packet = s->frames_per_packet; /* set encoding delay */ - speex_encoder_ctl(s->enc_state, SPEEX_GET_LOOKAHEAD, &avctx->delay); + speex_encoder_ctl(s->enc_state, SPEEX_GET_LOOKAHEAD, &avctx->initial_padding); ff_af_queue_init(avctx, &s->afq); /* create header packet bytes from header struct */ @@ -243,8 +243,8 @@ static av_cold int encode_init(AVCodecContext *avctx) below with speex_header_free() */ header_data = speex_header_to_packet(&s->header, &header_size); - /* allocate extradata and coded_frame */ - avctx->extradata = av_malloc(header_size + FF_INPUT_BUFFER_PADDING_SIZE); + /* allocate extradata */ + avctx->extradata = av_malloc(header_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!avctx->extradata) { speex_header_free(header_data); speex_encoder_destroy(s->enc_state); @@ -357,7 +357,7 @@ AVCodec ff_libspeex_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_close, - .capabilities = CODEC_CAP_DELAY, + .capabilities = AV_CODEC_CAP_DELAY, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO,