static int videotoolbox_common_end_frame(AVCodecContext *avctx, AVFrame *frame)

{

    int status;

    AVVideotoolboxContext *videotoolbox = avctx->hwaccel_context;

    VTContext *vtctx = avctx->internal->hwaccel_priv_data;



    av_buffer_unref(&frame->buf[0]);



    if (!videotoolbox->session || !vtctx->bitstream)

        return AVERROR_INVALIDDATA;



    status = videotoolbox_session_decode_frame(avctx);



    if (status) {

        av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status);

        return AVERROR_UNKNOWN;

    }



    if (!vtctx->frame)

        return AVERROR_UNKNOWN;



    return ff_videotoolbox_buffer_create(vtctx, frame);

}

static int videotoolbox_common_end_frame(AVCodecContext *avctx, AVFrame *frame)

{

    int status;

    AVVideotoolboxContext *videotoolbox = avctx->hwaccel_context;

    VTContext *vtctx = avctx->internal->hwaccel_priv_data;



    av_buffer_unref(&frame->buf[0]);



    if (!videotoolbox->session || !vtctx->bitstream)

        return AVERROR_INVALIDDATA;



    status = videotoolbox_session_decode_frame(avctx);



    if (status) {

        av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status);

        return AVERROR_UNKNOWN;

    }



    if (!vtctx->frame)

        return AVERROR_UNKNOWN;



    return ff_videotoolbox_buffer_create(vtctx, frame);

}

    av_buffer_unref(&frame->buf[0]);
static int FUNC_0(AVCodecContext *VAR_0, AVFrame *VAR_1)

{

    int VAR_2;

    AVVideotoolboxContext *videotoolbox = VAR_0->hwaccel_context;

    VTContext *vtctx = VAR_0->internal->hwaccel_priv_data;



    av_buffer_unref(&VAR_1->buf[0]);



    if (!videotoolbox->session || !vtctx->bitstream)

        return AVERROR_INVALIDDATA;



    VAR_2 = videotoolbox_session_decode_frame(VAR_0);



    if (VAR_2) {

        av_log(VAR_0, AV_LOG_ERROR, "Failed to decode VAR_1 (%d)\n", VAR_2);

        return AVERROR_UNKNOWN;

    }



    if (!vtctx->VAR_1)

        return AVERROR_UNKNOWN;



    return ff_videotoolbox_buffer_create(vtctx, VAR_1);

}

static int FUNC_0(AVCodecContext *VAR_0, AVFrame *VAR_1)
{ int VAR_2; AVVideotoolboxContext *videotoolbox = VAR_0->hwaccel_context; VTContext *vtctx = VAR_0->internal->hwaccel_priv_data; av_buffer_unref(&VAR_1->buf[0]); if (!videotoolbox->session || !vtctx->bitstream)
return AVERROR_INVALIDDATA; VAR_2 = videotoolbox_session_decode_frame(VAR_0); if (VAR_2) { av_log(VAR_0, AV_LOG_ERROR, "Failed to decode VAR_1 (%d)\n", VAR_2); return AVERROR_UNKNOWN; } if (!vtctx->VAR_1)
return AVERROR_UNKNOWN; return ff_videotoolbox_buffer_create(vtctx, VAR_1); }