Fix crash when item has no media sources

This commit is contained in:
Niels van Velzen 2024-07-07 22:07:18 +02:00 committed by Niels van Velzen
parent eacbfe7005
commit 08cb004b99

View File

@ -520,8 +520,9 @@ public class PlaybackController implements PlaybackControllerNotifiable {
internalOptions.setEnableDirectStream(false);
internalOptions.setMaxAudioChannels(Utils.downMixAudio(mFragment.getContext()) ? 2 : null); //have to downmix at server
internalOptions.setSubtitleStreamIndex(forcedSubtitleIndex);
if (!isLiveTv) {
internalOptions.setMediaSourceId(getCurrentMediaSource().getId());
MediaSourceInfo currentMediaSource = getCurrentMediaSource();
if (!isLiveTv && currentMediaSource != null) {
internalOptions.setMediaSourceId(currentMediaSource.getId());
}
DeviceProfile internalProfile = new ExoPlayerProfile(
mFragment.getContext(),