diff --git a/app/src/main/java/org/jellyfin/androidtv/data/compat/StreamInfo.java b/app/src/main/java/org/jellyfin/androidtv/data/compat/StreamInfo.java index 9e42e6a165..4c7a52872e 100644 --- a/app/src/main/java/org/jellyfin/androidtv/data/compat/StreamInfo.java +++ b/app/src/main/java/org/jellyfin/androidtv/data/compat/StreamInfo.java @@ -2,13 +2,13 @@ import org.jellyfin.apiclient.model.dlna.DeviceProfile; import org.jellyfin.apiclient.model.dlna.EncodingContext; -import org.jellyfin.apiclient.model.dlna.SubtitleDeliveryMethod; import org.jellyfin.apiclient.model.dlna.SubtitleProfile; import org.jellyfin.apiclient.model.dlna.TranscodeSeekInfo; import org.jellyfin.apiclient.model.session.PlayMethod; import org.jellyfin.sdk.model.api.MediaSourceInfo; import org.jellyfin.sdk.model.api.MediaStream; import org.jellyfin.sdk.model.api.MediaStreamType; +import org.jellyfin.sdk.model.api.SubtitleDeliveryMethod; import java.util.ArrayList; import java.util.UUID; @@ -100,10 +100,10 @@ public final void setMediaSource(MediaSourceInfo value) { MediaSource = value; } - private SubtitleDeliveryMethod SubtitleDeliveryMethod = getSubtitleDeliveryMethod().values()[0]; - - public final SubtitleDeliveryMethod getSubtitleDeliveryMethod() { - return SubtitleDeliveryMethod; + public final org.jellyfin.sdk.model.api.SubtitleDeliveryMethod getSubtitleDeliveryMethod() { + Integer subtitleStreamIndex = MediaSource.getDefaultSubtitleStreamIndex(); + if (subtitleStreamIndex == null || subtitleStreamIndex == -1) return SubtitleDeliveryMethod.DROP; + return MediaSource.getMediaStreams().get(subtitleStreamIndex).getDeliveryMethod(); } private String PlaySessionId; diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/PlaybackController.java b/app/src/main/java/org/jellyfin/androidtv/ui/playback/PlaybackController.java index 43755b8fb3..05f7b9f9b6 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/PlaybackController.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/PlaybackController.java @@ -32,7 +32,6 @@ import org.jellyfin.apiclient.interaction.ApiClient; import org.jellyfin.apiclient.interaction.Response; import org.jellyfin.apiclient.model.dlna.DeviceProfile; -import org.jellyfin.apiclient.model.dlna.SubtitleDeliveryMethod; import org.jellyfin.apiclient.model.session.PlayMethod; import org.jellyfin.sdk.model.api.BaseItemDto; import org.jellyfin.sdk.model.api.BaseItemKind; @@ -40,6 +39,7 @@ import org.jellyfin.sdk.model.api.MediaSourceInfo; import org.jellyfin.sdk.model.api.MediaStream; import org.jellyfin.sdk.model.api.MediaStreamType; +import org.jellyfin.sdk.model.api.SubtitleDeliveryMethod; import org.jellyfin.sdk.model.serializer.UUIDSerializerKt; import org.koin.java.KoinJavaComponent; @@ -542,7 +542,7 @@ public void onResponse(StreamInfo internalResponse) { if (mVideoManager == null) return; mCurrentOptions = internalOptions; - if (internalOptions.getSubtitleStreamIndex() == null) burningSubs = internalResponse.getSubtitleDeliveryMethod() == SubtitleDeliveryMethod.Encode; + if (internalOptions.getSubtitleStreamIndex() == null) burningSubs = internalResponse.getSubtitleDeliveryMethod() == SubtitleDeliveryMethod.ENCODE; startItem(item, position, internalResponse); } @@ -590,7 +590,7 @@ private void startItem(BaseItemDto item, long position, StreamInfo response) { if (response.getMediaUrl() == null) { // If baking subtitles doesn't work (e.g. no permissions to transcode), disable them - if (response.getSubtitleDeliveryMethod() == SubtitleDeliveryMethod.Encode && (response.getMediaSource().getDefaultSubtitleStreamIndex() == null || response.getMediaSource().getDefaultSubtitleStreamIndex() != -1)) { + if (response.getSubtitleDeliveryMethod() == SubtitleDeliveryMethod.ENCODE && (response.getMediaSource().getDefaultSubtitleStreamIndex() == null || response.getMediaSource().getDefaultSubtitleStreamIndex() != -1)) { burningSubs = false; stop(); play(position, -1);