From 550299db9ab968725c552c7d5ec7af52333ebd52 Mon Sep 17 00:00:00 2001 From: hschlueter Date: Tue, 1 Mar 2022 12:53:39 +0000 Subject: [PATCH] Avoid duplicate logging of GL exceptions. Only log GL exceptions in GlUtil if they aren't thrown. Otherwise, it's up to the caller whether or not to log them to avoid logging them twice. PiperOrigin-RevId: 431657397 --- .../main/java/com/google/android/exoplayer2/util/GlUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java b/library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java index 9ea8e6fb20..a349120dfc 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java @@ -376,9 +376,10 @@ public final class GlUtil { } /* package */ static void throwGlException(String errorMsg) { - Log.e(TAG, errorMsg); if (glAssertionsEnabled) { throw new GlException(errorMsg); + } else { + Log.e(TAG, errorMsg); } }