Commit d0a16051 authored by Hendrik Leppkes's avatar Hendrik Leppkes

Merge commit '3ee462dc'

* commit '3ee462dc':
  examples/qsvdec: do not free the surfaces in the frame_free() callback
Merged-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
parents 9457a11a 3ee462dc
......@@ -116,15 +116,6 @@ fail:
static mfxStatus frame_free(mfxHDL pthis, mfxFrameAllocResponse *resp)
{
DecodeContext *decode = pthis;
if (decode->surfaces)
vaDestroySurfaces(decode->va_dpy, decode->surfaces, decode->nb_surfaces);
av_freep(&decode->surfaces);
av_freep(&decode->surface_ids);
av_freep(&decode->surface_used);
decode->nb_surfaces = 0;
return MFX_ERR_NONE;
}
......@@ -144,6 +135,16 @@ static mfxStatus frame_get_hdl(mfxHDL pthis, mfxMemId mid, mfxHDL *hdl)
return MFX_ERR_NONE;
}
static void free_surfaces(DecodeContext *decode)
{
if (decode->surfaces)
vaDestroySurfaces(decode->va_dpy, decode->surfaces, decode->nb_surfaces);
av_freep(&decode->surfaces);
av_freep(&decode->surface_ids);
av_freep(&decode->surface_used);
decode->nb_surfaces = 0;
}
static void free_buffer(void *opaque, uint8_t *data)
{
int *used = opaque;
......@@ -467,6 +468,8 @@ finish:
av_frame_free(&frame);
free_surfaces(&decode);
if (decode.mfx_session)
MFXClose(decode.mfx_session);
if (decode.va_dpy)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment