X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibschroedingerenc.c;h=44d4dcd428fe0797008ec30b42b546c8e49da093;hb=b3507d398b703ed8f06d8608f254c3937a7a42b0;hp=94033cc2562f96e191947075cc9fa22ca3c7053a;hpb=0ebe3b8e2bf74503d7c9cc383e29254a3cb06d55;p=ffmpeg diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c index 94033cc2562..44d4dcd428f 100644 --- a/libavcodec/libschroedingerenc.c +++ b/libavcodec/libschroedingerenc.c @@ -223,15 +223,13 @@ static SchroFrame *libschroedinger_frame_from_data(AVCodecContext *avccontext, /* Input line size may differ from what the codec supports. Especially * when transcoding from one format to another. So use avpicture_layout * to copy the frame. */ - in_frame = schro_frame_new_and_alloc(NULL, - p_schro_params->frame_format, - p_schro_params->format->width, - p_schro_params->format->height); + in_frame = ff_create_schro_frame(avccontext, p_schro_params->frame_format); - avpicture_layout((AVPicture *)in_data, avccontext->pix_fmt, - avccontext->width, avccontext->height, - in_frame->components[0].data, - p_schro_params->frame_size); + if (in_frame) + avpicture_layout((AVPicture *)in_data, avccontext->pix_fmt, + avccontext->width, avccontext->height, + in_frame->components[0].data, + p_schro_params->frame_size); return in_frame; } @@ -416,6 +414,6 @@ AVCodec libschroedinger_encoder = { libschroedinger_encode_frame, libschroedinger_encode_close, .capabilities = CODEC_CAP_DELAY, - .pix_fmts = (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE}, + .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"), };