Description: MS2_PLUGINS_LOCATION -> MEDIASTREAMER2_PLUGINS_LOCATION
 CMake variable was renamed, but not everything was updated.
 .
 This defect revealed a ton of crash-producing problems in
 mediastreamer2/src/base/msfilter.c wrt. checking for NULL pointers
 when the plugins for whatever cannot be loaded.  Example stack trace
 from clicking Video Preview in Preferences → Video:
 .
 #0  0x00007ffff75c50dd in ms_filter_link (f1=0x7fff4439a910, pin1=pin1@entry=1, f2=0x0, pin2=pin2@entry=0) at mediastreamer2/src/base/msfilter.c:121
 #1  0x00007ffff760f193 in video_preview_start (stream=0x7fff4477e5e0, device=‹optimized out›) at mediastreamer2/src/voip/videostream.c:1948
 #2  0x00007ffff7cfcfe5 in ?? () from /lib/x86_64-linux-gnu/liblinphone.so.10
 #3  0x00007ffff7d051e8 in linphone_core_get_native_preview_window_id () from /lib/x86_64-linux-gnu/liblinphone.so.10
 #4  0x00005555556b74bf in CameraPreview::createRenderer (this=‹optimized out›) at linphone-desktop/linphone-app/src/components/camera/CameraPreview.cpp:90
 .
 There is also absolutely no need for this to be compiled into
 linphone.  Instead it should be queried at run-time by asking
 mediastreamer2 where its plugin directory is.
Author: Dennis Filder <d.filder@web.de>
Forwarded: TBD
Last-Update: 2022-10-07
--- a/linphone-app/CMakeLists.txt
+++ b/linphone-app/CMakeLists.txt
@@ -612,13 +612,17 @@
 	message("Qt5 Paths : Qt5_DIR=$ENV{Qt5_DIR}, PATH=$ENV{PATH}")
 endif()
 if(APPLE)
-	if(MS2_PLUGINS_LOCATION)
-		set(MSPLUGINS_DIR ${MS2_PLUGINS_LOCATION})
+	if(MEDIASTREAMER2_PLUGINS_LOCATION)
+		set(MSPLUGINS_DIR ${MEDIASTREAMER2_PLUGINS_LOCATION})
 	else()
 		set(MSPLUGINS_DIR "Frameworks/mediastreamer2.framework/Versions/A/Libraries")
 	endif()
 else()
-	set(MSPLUGINS_DIR "plugins/mediastreamer")
+	if(MEDIASTREAMER2_PLUGINS_LOCATION)
+		set(MSPLUGINS_DIR ${MEDIASTREAMER2_PLUGINS_LOCATION})
+	else()
+		set(MSPLUGINS_DIR "plugins/mediastreamer")
+	endif()
 endif()
 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config.h")
 # ------------------------------------------------------------------------------
