X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Froqaudioenc.c;h=9a636179b1c9f0a6906b8d8af0d17d607f188cef;hb=a247ac640df3da573cd661065bf53f37863e2b46;hp=5154604be8fd382ca387f2848e624465da2fbb34;hpb=ef71ef5f30ddf1cd61e46628a04608892caf76d2;p=ffmpeg diff --git a/libavcodec/roqaudioenc.c b/libavcodec/roqaudioenc.c index 5154604be8f..9a636179b1c 100644 --- a/libavcodec/roqaudioenc.c +++ b/libavcodec/roqaudioenc.c @@ -53,7 +53,6 @@ static av_cold int roq_dpcm_encode_close(AVCodecContext *avctx) static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx) { ROQDPCMContext *context = avctx->priv_data; - int ret; if (avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\n"); @@ -70,17 +69,12 @@ static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx) context->frame_buffer = av_malloc(8 * ROQ_FRAME_SIZE * avctx->channels * sizeof(*context->frame_buffer)); - if (!context->frame_buffer) { - ret = AVERROR(ENOMEM); - goto error; - } + if (!context->frame_buffer) + return AVERROR(ENOMEM); context->lastSample[0] = context->lastSample[1] = 0; return 0; -error: - roq_dpcm_encode_close(avctx); - return ret; } static unsigned char dpcm_predict(short *previous, short current) @@ -189,7 +183,7 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -AVCodec ff_roq_dpcm_encoder = { +const AVCodec ff_roq_dpcm_encoder = { .name = "roq_dpcm", .long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"), .type = AVMEDIA_TYPE_AUDIO,