From a850bf786e3bea2ce9969d6794835a0724f29b0d Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 31 Dec 2014 20:31:19 +0100 Subject: vo_opengl_cb: simplify API uninitialization Until now, calling mpv_opengl_cb_uninit_gl() at a "bad moment" could make the whole thing to explode. The API user was asked to avoid such situations by calling it only in "good moments". But this was probably a bit too subtle and could easily be overlooked. Integrate the approach the qml example uses directly into the implementation. If the OpenGL context is to be unitialized, forcefully disable video, and block until this is done. --- DOCS/client_api_examples/qml/mpvrenderer.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'DOCS/client_api_examples') diff --git a/DOCS/client_api_examples/qml/mpvrenderer.cpp b/DOCS/client_api_examples/qml/mpvrenderer.cpp index 13c1f0a747..6d214dfba8 100644 --- a/DOCS/client_api_examples/qml/mpvrenderer.cpp +++ b/DOCS/client_api_examples/qml/mpvrenderer.cpp @@ -32,15 +32,9 @@ public: virtual ~MpvRenderer() { - // Before we can really destroy the OpenGL state, we must make sure - // that the video output is destroyed. This is important for some - // forms of hardware decoding, where the decoder shares some state - // with the video output and the OpenGL context. - // Deselecting the video track is the easiest way to achieve this in - // a synchronous way. If no file is playing, setting the property - // will fail and do nothing. - mpv::qt::set_property_variant(mpv, "vid", "no"); - + // Until this call is done, we need to make sure the player remains + // alive. This is done implicitly with the mpv::qt::Handle instance + // in this class. mpv_opengl_cb_uninit_gl(mpv_gl); } -- cgit v1.2.3