diff options
author | wm4 <wm4@nowhere> | 2014-12-31 20:31:19 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-31 20:31:19 +0100 |
commit | a850bf786e3bea2ce9969d6794835a0724f29b0d (patch) | |
tree | 9e58453886384f98824d3885bf8a5281d07ccfc7 /DOCS | |
parent | 65f2c6c71676e4359d313ecf27744e525b662134 (diff) | |
download | mpv-a850bf786e3bea2ce9969d6794835a0724f29b0d.tar.bz2 mpv-a850bf786e3bea2ce9969d6794835a0724f29b0d.tar.xz |
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.
Diffstat (limited to 'DOCS')
-rw-r--r-- | DOCS/client_api_examples/qml/mpvrenderer.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
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); } |