[GStreamer][EME] Fix warnings in LOG_DISABLED build
authorcturner@igalia.com <cturner@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Feb 2020 18:05:04 +0000 (18:05 +0000)
committercturner@igalia.com <cturner@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Feb 2020 18:05:04 +0000 (18:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=207691

Unreviewed build fix.

* platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: It would
be nice if the LOG macros could arrange for the VA_ARGS to be
UNUSED_VARIABLE's. Not sure if that is possible, so be ugly with
the ifdef's instead.
(WebCore::CDMProxyClearKey::cencSetCounterVector):
(WebCore::CDMProxyClearKey::cencSetDecryptionKey):
(WebCore::CDMProxyClearKey::cencDecryptFullSample):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256620 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp

index 1a0bb1b..200d973 100644 (file)
@@ -1,3 +1,18 @@
+2020-02-14  Charles Turner  <cturner@igalia.com>
+
+        [GStreamer][EME] Fix warnings in LOG_DISABLED build
+        https://bugs.webkit.org/show_bug.cgi?id=207691
+
+        Unreviewed build fix.
+
+        * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: It would
+        be nice if the LOG macros could arrange for the VA_ARGS to be
+        UNUSED_VARIABLE's. Not sure if that is possible, so be ugly with
+        the ifdef's instead.
+        (WebCore::CDMProxyClearKey::cencSetCounterVector):
+        (WebCore::CDMProxyClearKey::cencSetDecryptionKey):
+        (WebCore::CDMProxyClearKey::cencDecryptFullSample):
+
 2020-02-14  Antoine Quint  <graouts@webkit.org>
 
         [Web Animations] Ensure CSS Transition and CSS Animation events are queued, sorted and dispatched by their timeline
index 8040452..6c4250d 100644 (file)
@@ -84,7 +84,11 @@ bool CDMProxyClearKey::cencSetCounterVector(const cencDecryptContext& input)
         memcpy(ctr, input.iv, ClearKey::IVSizeInBytes);
 
     if (gcry_error_t cipherError = gcry_cipher_setctr(m_gcryHandle, ctr, ClearKey::IVSizeInBytes)) {
+#if !LOG_DISABLED
         LOG(EME, "EME - CDMProxyClearKey - ERROR(gcry_cipher_setctr): %s", gpg_strerror(cipherError));
+#else
+        UNUSED_VARIABLE(cipherError);
+#endif
         return false;
     }
 
@@ -103,8 +107,12 @@ bool CDMProxyClearKey::cencSetDecryptionKey(const cencDecryptContext& in)
     if (!keyData)
         return false;
 
-    if (gcry_error_t error = gcry_cipher_setkey(m_gcryHandle, keyData->data(), keyData->size())) {
-        LOG(EME, "EME - CDMProxyClearKey - ERROR(gcry_cipher_setkey): %s", gpg_strerror(error));
+    if (gcry_error_t cipherError = gcry_cipher_setkey(m_gcryHandle, keyData->data(), keyData->size())) {
+#if !LOG_DISABLED
+        LOG(EME, "EME - CDMProxyClearKey - ERROR(gcry_cipher_setkey): %s", gpg_strerror(cipherError));
+#else
+        UNUSED_VARIABLE(cipherError);
+#endif
         return false;
     }
 
@@ -119,7 +127,11 @@ bool CDMProxyClearKey::cencDecryptFullSample(cencDecryptContext& in)
     LOG(EME, "EME - CDMProxyClearKey - full-sample decryption: %zu encrypted bytes", in.encryptedBufferSizeInBytes);
 
     if (gcry_error_t cipherError = gcry_cipher_decrypt(m_gcryHandle, in.encryptedBuffer, in.encryptedBufferSizeInBytes, 0, 0)) {
+#if !LOG_DISABLED
         LOG(EME, "EME - CDMProxyClearKey - ERROR(gcry_cipher_decrypt): %s", gpg_strerror(cipherError));
+#else
+        UNUSED_VARIABLE(cipherError);
+#endif
         return false;
     }