[FFmpeg-cvslog] lavfi/vulkan: allow calling glslang_uninit without a prior init

Lynne git at videolan.org
Thu Nov 26 00:15:16 EET 2020


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Sun Nov 22 23:08:33 2020 +0100| [ae8fc9922eb51ce8628f3e3333d1fe817518ca76] | committer: Lynne

lavfi/vulkan: allow calling glslang_uninit without a prior init

Allows us to uninit cleanly.
This assert was also somewhat pointless as we assert every other
function, so another assert would be triggered long before this
one is.

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

 libavfilter/glslang.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavfilter/glslang.cpp b/libavfilter/glslang.cpp
index 125eb5c364..986bddd789 100644
--- a/libavfilter/glslang.cpp
+++ b/libavfilter/glslang.cpp
@@ -235,8 +235,7 @@ int glslang_init(void)
 void glslang_uninit(void)
 {
     pthread_mutex_lock(&glslang_mutex);
-    av_assert0(glslang_refcount > 0);
-    if (--glslang_refcount == 0)
+    if (glslang_refcount && (--glslang_refcount == 0))
         FinalizeProcess();
     pthread_mutex_unlock(&glslang_mutex);
 }



More information about the ffmpeg-cvslog mailing list