mirror of https://git.ffmpeg.org/ffmpeg.git
adxenc: Use the AVFrame in ADXContext for coded_frame
This commit is contained in:
parent
68fd077f68
commit
54e6cf8a94
|
@ -119,7 +119,8 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
|
||||||
}
|
}
|
||||||
avctx->frame_size = BLOCK_SAMPLES;
|
avctx->frame_size = BLOCK_SAMPLES;
|
||||||
|
|
||||||
avctx->coded_frame = avcodec_alloc_frame();
|
avcodec_get_frame_defaults(&c->frame);
|
||||||
|
avctx->coded_frame = &c->frame;
|
||||||
|
|
||||||
/* the cutoff can be adjusted, but this seems to work pretty well */
|
/* the cutoff can be adjusted, but this seems to work pretty well */
|
||||||
c->cutoff = 500;
|
c->cutoff = 500;
|
||||||
|
@ -128,12 +129,6 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold int adx_encode_close(AVCodecContext *avctx)
|
|
||||||
{
|
|
||||||
av_freep(&avctx->coded_frame);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int adx_encode_frame(AVCodecContext *avctx, uint8_t *frame,
|
static int adx_encode_frame(AVCodecContext *avctx, uint8_t *frame,
|
||||||
int buf_size, void *data)
|
int buf_size, void *data)
|
||||||
{
|
{
|
||||||
|
@ -171,7 +166,6 @@ AVCodec ff_adpcm_adx_encoder = {
|
||||||
.priv_data_size = sizeof(ADXContext),
|
.priv_data_size = sizeof(ADXContext),
|
||||||
.init = adx_encode_init,
|
.init = adx_encode_init,
|
||||||
.encode = adx_encode_frame,
|
.encode = adx_encode_frame,
|
||||||
.close = adx_encode_close,
|
|
||||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
|
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
|
||||||
AV_SAMPLE_FMT_NONE },
|
AV_SAMPLE_FMT_NONE },
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
|
.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
|
||||||
|
|
Loading…
Reference in New Issue