Description: Download codec only if permitted through envvar (#1009210)
 Prevent codec download unless user opts in and print an informative message.
Last-Update: 2022-10-08
--- a/linphone-app/src/components/codecs/VideoCodecsModel.cpp
+++ b/linphone-app/src/components/codecs/VideoCodecsModel.cpp
@@ -136,7 +136,11 @@
 
 void VideoCodecsModel::downloadUpdatableCodecs (QObject *parent) {
   #if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
-    downloadUpdatableCodec(parent, getCodecsFolder(), "H264", Constants::PluginUrlH264, Constants::H264InstallName, Constants::PluginH264Check);
+    if (getenv("LINPHONE_DO_CODEC_DOWNLOAD")) {
+        downloadUpdatableCodec(parent, getCodecsFolder(), "H264", Constants::PluginUrlH264, Constants::H264InstallName, Constants::PluginH264Check);
+    } else {
+        qInfo() << QStringLiteral("Codec download disabled.  Install package mediastreamer2-plugin-openh264 or set LINPHONE_DO_CODEC_DOWNLOAD=y in the environment and restart linphone to retry.");
+    }
   #else
     Q_UNUSED(parent);
   #endif // if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
