[FFmpeg-cvslog] examples/qsvdec: free the lavc decoder before closing MFX/VAAPI

Anton Khirnov git at videolan.org
Tue Sep 29 14:17:45 CEST 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Aug 11 15:00:24 2015 +0200| [539e5ac2ecfec2e2f441222a43fb0583643ea607] | committer: Anton Khirnov

examples/qsvdec: free the lavc decoder before closing MFX/VAAPI

lavc expects MFX to still be in a usable state on close.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=539e5ac2ecfec2e2f441222a43fb0583643ea607
---

 doc/examples/qsvdec.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/examples/qsvdec.c b/doc/examples/qsvdec.c
index 2f26f41..fd934be 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;



More information about the ffmpeg-cvslog mailing list