examples/qsvdec: free the lavc decoder before closing MFX/VAAPI
lavc expects MFX to still be in a usable state on close.
This commit is contained in:
parent
3ee462dca1
commit
539e5ac2ec
@ -468,6 +468,10 @@ finish:
|
|||||||
|
|
||||||
av_frame_free(&frame);
|
av_frame_free(&frame);
|
||||||
|
|
||||||
|
if (decoder_ctx)
|
||||||
|
av_freep(&decoder_ctx->hwaccel_context);
|
||||||
|
avcodec_free_context(&decoder_ctx);
|
||||||
|
|
||||||
free_surfaces(&decode);
|
free_surfaces(&decode);
|
||||||
|
|
||||||
if (decode.mfx_session)
|
if (decode.mfx_session)
|
||||||
@ -477,10 +481,6 @@ finish:
|
|||||||
if (dpy)
|
if (dpy)
|
||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
|
|
||||||
if (decoder_ctx)
|
|
||||||
av_freep(&decoder_ctx->hwaccel_context);
|
|
||||||
avcodec_free_context(&decoder_ctx);
|
|
||||||
|
|
||||||
avio_close(output_ctx);
|
avio_close(output_ctx);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user