[Android] Fix some warnings
Nicolas Pomepuy
git at videolan.org
Mon Oct 3 11:10:29 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Sep 28 07:22:50 2022 +0200| [e3b331da6f32306b613580ad0b573e54724e3415] | committer: Duncan McNamara
Fix some warnings
> https://code.videolan.org/videolan/vlc-android/commit/e3b331da6f32306b613580ad0b573e54724e3415
---
.../vlc-android/vlc3/src/org/videolan/vlc/VersionDependant.kt | 6 +++---
medialibrary/vlc3/src/org/videolan/vlc/VlcMigrationHelper.java | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/application/vlc-android/vlc3/src/org/videolan/vlc/VersionDependant.kt b/application/vlc-android/vlc3/src/org/videolan/vlc/VersionDependant.kt
index 8edbc6603..c9d2dc757 100644
--- a/application/vlc-android/vlc3/src/org/videolan/vlc/VersionDependant.kt
+++ b/application/vlc-android/vlc3/src/org/videolan/vlc/VersionDependant.kt
@@ -47,11 +47,11 @@ fun IMedia.getAllTracks(): List<IMedia.Track> {
}
-fun MediaPlayer.getSelectedVideoTrack(): VlcTrack? = getCurrentVideoTrack()?.let { VlcTrackImpl(it) } ?: null
+fun MediaPlayer.getSelectedVideoTrack(): VlcTrack? = currentVideoTrack?.let { VlcTrackImpl(it) }
fun MediaPlayer.getSelectedAudioTrack(): VlcTrack? {
val currentTrackId = audioTrack
- getAudioTracks().forEach {
+ audioTracks.forEach {
if (it.id == currentTrackId) return VlcTrackImpl(it)
}
return null
@@ -59,7 +59,7 @@ fun MediaPlayer.getSelectedAudioTrack(): VlcTrack? {
fun MediaPlayer.getSelectedSpuTrack(): VlcTrack? {
val currentTrackId = spuTrack
- getSpuTracks().forEach {
+ spuTracks.forEach {
if (it.id == currentTrackId) return VlcTrackImpl(it)
}
return null
diff --git a/medialibrary/vlc3/src/org/videolan/vlc/VlcMigrationHelper.java b/medialibrary/vlc3/src/org/videolan/vlc/VlcMigrationHelper.java
index 585a2a2c4..4027585f7 100644
--- a/medialibrary/vlc3/src/org/videolan/vlc/VlcMigrationHelper.java
+++ b/medialibrary/vlc3/src/org/videolan/vlc/VlcMigrationHelper.java
@@ -31,7 +31,7 @@ import java.util.List;
public class VlcMigrationHelper {
public static List<IMedia.Track> getMediaTracks(IMedia media) {
- ArrayList<IMedia.Track> result = new ArrayList();
+ ArrayList<IMedia.Track> result = new ArrayList<>();
for (int i = 0; i < media.getTrackCount(); ++i) {
result.add(media.getTrack(i));
}
More information about the Android
mailing list