static void close_decoder(QSVContext *q)

{

    QSVFrame *cur;



    if (q->session)

        MFXVideoDECODE_Close(q->session);



    while (q->async_fifo && av_fifo_size(q->async_fifo)) {

        QSVFrame *out_frame;

        mfxSyncPoint *sync;



        av_fifo_generic_read(q->async_fifo, &out_frame, sizeof(out_frame), NULL);

        av_fifo_generic_read(q->async_fifo, &sync,      sizeof(sync),      NULL);



        av_freep(&sync);

    }



    cur = q->work_frames;

    while (cur) {

        q->work_frames = cur->next;

        av_frame_free(&cur->frame);

        av_freep(&cur);

        cur = q->work_frames;

    }



    q->engine_ready   = 0;

    q->reinit_pending = 0;

}

static void close_decoder(QSVContext *q)

{

    QSVFrame *cur;



    if (q->session)

        MFXVideoDECODE_Close(q->session);



    while (q->async_fifo && av_fifo_size(q->async_fifo)) {

        QSVFrame *out_frame;

        mfxSyncPoint *sync;



        av_fifo_generic_read(q->async_fifo, &out_frame, sizeof(out_frame), NULL);

        av_fifo_generic_read(q->async_fifo, &sync,      sizeof(sync),      NULL);



        av_freep(&sync);

    }



    cur = q->work_frames;

    while (cur) {

        q->work_frames = cur->next;

        av_frame_free(&cur->frame);

        av_freep(&cur);

        cur = q->work_frames;

    }



    q->engine_ready   = 0;

    q->reinit_pending = 0;

}

    while (q->async_fifo && av_fifo_size(q->async_fifo)) {         QSVFrame *out_frame;         mfxSyncPoint *sync;         av_fifo_generic_read(q->async_fifo, &out_frame, sizeof(out_frame), NULL);         av_fifo_generic_read(q->async_fifo, &sync,      sizeof(sync),      NULL);         av_freep(&sync);         av_freep(&sync);         av_freep(&sync);         av_freep(&sync);
static void FUNC_0(QSVContext *VAR_0)

{

    QSVFrame *cur;



    if (VAR_0->session)

        MFXVideoDECODE_Close(VAR_0->session);



    while (VAR_0->async_fifo && av_fifo_size(VAR_0->async_fifo)) {

        QSVFrame *out_frame;

        mfxSyncPoint *sync;



        av_fifo_generic_read(VAR_0->async_fifo, &out_frame, sizeof(out_frame), NULL);

        av_fifo_generic_read(VAR_0->async_fifo, &sync,      sizeof(sync),      NULL);



        av_freep(&sync);

    }



    cur = VAR_0->work_frames;

    while (cur) {

        VAR_0->work_frames = cur->next;

        av_frame_free(&cur->frame);

        av_freep(&cur);

        cur = VAR_0->work_frames;

    }



    VAR_0->engine_ready   = 0;

    VAR_0->reinit_pending = 0;

}

static void FUNC_0(QSVContext *VAR_0)
{ QSVFrame *cur; if (VAR_0->session)
MFXVideoDECODE_Close(VAR_0->session); while (VAR_0->async_fifo && av_fifo_size(VAR_0->async_fifo)) { QSVFrame *out_frame; mfxSyncPoint *sync; av_fifo_generic_read(VAR_0->async_fifo, &out_frame, sizeof(out_frame), NULL); av_fifo_generic_read(VAR_0->async_fifo, &sync,      sizeof(sync),      NULL); av_freep(&sync); } cur = VAR_0->work_frames; while (cur) { VAR_0->work_frames = cur->next; av_frame_free(&cur->frame); av_freep(&cur); cur = VAR_0->work_frames; } VAR_0->engine_ready   = 0; VAR_0->reinit_pending = 0; }