diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-21 13:30:37 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-21 15:04:42 -0400 |
commit | 54e6cf8a940a48e08b93f57c3801b9a213371701 (patch) | |
tree | 11160f487990874e34e48f835b15512c50459a0a /libavcodec/adxenc.c | |
parent | 68fd077f68bdde864bb7328d72a040849c616261 (diff) | |
download | ffmpeg-54e6cf8a940a48e08b93f57c3801b9a213371701.tar.gz |
adxenc: Use the AVFrame in ADXContext for coded_frame
Diffstat (limited to 'libavcodec/adxenc.c')
-rw-r--r-- | libavcodec/adxenc.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c index 20f27981c8..591c075749 100644 --- a/libavcodec/adxenc.c +++ b/libavcodec/adxenc.c @@ -119,7 +119,8 @@ static av_cold int adx_encode_init(AVCodecContext *avctx) } 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 */ c->cutoff = 500; @@ -128,12 +129,6 @@ static av_cold int adx_encode_init(AVCodecContext *avctx) 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, int buf_size, void *data) { @@ -171,7 +166,6 @@ AVCodec ff_adpcm_adx_encoder = { .priv_data_size = sizeof(ADXContext), .init = adx_encode_init, .encode = adx_encode_frame, - .close = adx_encode_close, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"), |