From 01ac2912f5ce46a78d2e8ebeda2dc64ca7e66b4b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 7 Feb 2024 10:55:01 +0100 Subject: [PATCH] catch exception when hardware renderer can not be set up --- .../eu/siacs/conversations/ui/RtpSessionActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index ddd5fbe8f..5b5c82bae 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -13,6 +13,7 @@ import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; +import android.opengl.GLException; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -836,8 +837,12 @@ public class RtpSessionActivity extends XmppActivity surfaceViewRenderer.setVisibility(View.VISIBLE); try { surfaceViewRenderer.init(requireRtpConnection().getEglBaseContext(), null); - } catch (final IllegalStateException e) { - // Log.d(Config.LOGTAG, "SurfaceViewRenderer was already initialized"); + } catch (final IllegalStateException ignored) { + // SurfaceViewRenderer was already initialized + } catch (final RuntimeException e) { + if (Throwables.getRootCause(e) instanceof GLException glException) { + Log.w(Config.LOGTAG, "could not set up hardware renderer", glException); + } } surfaceViewRenderer.setEnableHardwareScaler(true); }