summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-09-29 14:17:23 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-09-29 14:17:23 +0200
commitd0a1605134a8f697f3676b74518baec6e390d196 (patch)
tree6fd61efb6e644f1103657e59589c75084eea0245 /doc
parent9457a11a220c406ce3576ea78ca28c251c3240cf (diff)
parent3ee462dca1038e63b8e8d5e751121736d5772a5d (diff)
Merge commit '3ee462dca1038e63b8e8d5e751121736d5772a5d'
* commit '3ee462dca1038e63b8e8d5e751121736d5772a5d': examples/qsvdec: do not free the surfaces in the frame_free() callback Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/qsvdec.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/doc/examples/qsvdec.c b/doc/examples/qsvdec.c
index 04e5b5f85d..2f26f41ebd 100644
--- a/doc/examples/qsvdec.c
+++ b/doc/examples/qsvdec.c
@@ -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)