[Android] Display the subtitle delay UI for G/H keys and crash fix

Nicolas Pomepuy git at videolan.org
Wed Jun 16 04:28:56 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jun 15 11:38:01 2021 +0200| [9b0fb5d46f3dad4e5fe1c009a1b3e68293acbea1] | committer: Nicolas Pomepuy

Display the subtitle delay UI for G/H keys and crash fix

Fixes #182

> https://code.videolan.org/videolan/vlc-android/commit/9b0fb5d46f3dad4e5fe1c009a1b3e68293acbea1
---

 .../src/org/videolan/vlc/gui/video/VideoDelayDelegate.kt           | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoDelayDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoDelayDelegate.kt
index 15e272bf0..a71c1cba5 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoDelayDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoDelayDelegate.kt
@@ -216,12 +216,13 @@ class VideoDelayDelegate(private val player: VideoPlayerActivity) : View.OnClick
             }
             player.overlayDelegate.initInfoOverlay()
             if (delayState == IPlaybackSettingsController.DelayState.SUBS) service.setSpuDelay(delay) else service.setAudioDelay(delay)
-            delayTitle.text = player.getString(if (delayState == IPlaybackSettingsController.DelayState.SUBS) R.string.spu_delay else R.string.audio_delay)
-            delayInfo.text = "${delay / 1000L} ms"
+            if (::delayTitle.isInitialized) delayTitle.text =
+                player.getString(if (delayState == IPlaybackSettingsController.DelayState.SUBS) R.string.spu_delay else R.string.audio_delay)
+            if (::delayInfo.isInitialized) delayInfo.text = "${delay / 1000L} ms"
             if (delayState == IPlaybackSettingsController.DelayState.SUBS) spuDelay = delay else audioDelay = delay
             if (!player.isPlaybackSettingActive) {
                 playbackSetting = delayState
-                initPlaybackSettingInfo()
+                showDelayControls()
             }
         }
     }



More information about the Android mailing list