[Android] AspectRatio: fix wrong orientation with locale

Duncan McNamara git at videolan.org
Wed Apr 27 06:36:50 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Wed Apr 20 16:54:10 2022 +0200| [d93b91f17e82643173b1739453b9e89f44146ea9] | committer: Nicolas Pomepuy

AspectRatio: fix wrong orientation with locale

When setting a non default locale, the VideoPlayerActivity when in best
fit aspect ratio will not update it's configuration.orientation when
rotating, causing libvlc to assume that the orientation is still the one
used when starting the video. By forcing the orientation to its new
value in onConfigurationChange, this is fixed. Though it doesn't explain
why it has this behaviour in the first place. This is a workaround.

Fixes #2475

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

 .../vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index d1027ebde..c574b0d46 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -700,6 +700,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
                     newConfig.orientation)
             touchDelegate.screenConfig = sc
         }
+        this.resources.configuration.orientation = newConfig.orientation
         overlayDelegate.resetHudLayout()
         overlayDelegate.showControls(isShowing)
         statsDelegate.onConfigurationChanged()



More information about the Android mailing list