mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
sonicenc: don't allocate unused avctx->coded_frame
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
5285a7549f
commit
dc5c029f02
@ -596,10 +596,6 @@ static av_cold int sonic_encode_init(AVCodecContext *avctx)
|
|||||||
av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n",
|
av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n",
|
||||||
version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);
|
version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);
|
||||||
|
|
||||||
avctx->coded_frame = avcodec_alloc_frame();
|
|
||||||
if (!avctx->coded_frame)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
avctx->coded_frame->key_frame = 1;
|
|
||||||
avctx->frame_size = s->block_align*s->downsampling;
|
avctx->frame_size = s->block_align*s->downsampling;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -610,8 +606,6 @@ static av_cold int sonic_encode_close(AVCodecContext *avctx)
|
|||||||
SonicContext *s = avctx->priv_data;
|
SonicContext *s = avctx->priv_data;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
av_freep(&avctx->coded_frame);
|
|
||||||
|
|
||||||
for (i = 0; i < s->channels; i++)
|
for (i = 0; i < s->channels; i++)
|
||||||
av_free(s->coded_samples[i]);
|
av_free(s->coded_samples[i]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user