summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-08-11 15:00:24 +0200
committerAnton Khirnov <anton@khirnov.net>2015-09-28 15:46:10 +0200
commit539e5ac2ecfec2e2f441222a43fb0583643ea607 (patch)
tree3b8ae7ff10384aa52c754952bb65577c131b975a /doc
parent3ee462dca1038e63b8e8d5e751121736d5772a5d (diff)
examples/qsvdec: free the lavc decoder before closing MFX/VAAPI
lavc expects MFX to still be in a usable state on close.
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/qsvdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/examples/qsvdec.c b/doc/examples/qsvdec.c
index 2f26f41ebd..fd934bebd3 100644
--- a/doc/examples/qsvdec.c
+++ b/doc/examples/qsvdec.c
@@ -468,6 +468,10 @@ finish:
av_frame_free(&frame);
+ if (decoder_ctx)
+ av_freep(&decoder_ctx->hwaccel_context);
+ avcodec_free_context(&decoder_ctx);
+
free_surfaces(&decode);
if (decode.mfx_session)
@@ -477,10 +481,6 @@ finish:
if (dpy)
XCloseDisplay(dpy);
- if (decoder_ctx)
- av_freep(&decoder_ctx->hwaccel_context);
- avcodec_free_context(&decoder_ctx);
-
avio_close(output_ctx);
return ret;