mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Handle more possible issues with AutoSet.
This commit is contained in:
parent
40567aedca
commit
e0a13bfe6a
1 changed files with 25 additions and 5 deletions
|
@ -2230,10 +2230,20 @@ class PlaybackManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!prevSource.MediaStreams || !mediaSource.MediaStreams) {
|
||||||
|
console.debug(`AutoSet ${streamType} - No MediaStreams`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let bestStreamIndex = null;
|
let bestStreamIndex = null;
|
||||||
let bestStreamScore = 0;
|
let bestStreamScore = 0;
|
||||||
const prevStream = prevSource.MediaStreams[prevIndex];
|
const prevStream = prevSource.MediaStreams[prevIndex];
|
||||||
|
|
||||||
|
if (!prevStream) {
|
||||||
|
console.debug(`AutoSet ${streamType} - No prevStream`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
console.debug(`AutoSet ${streamType} - Previous was ${prevStream.Index} - ${prevStream.DisplayTitle}`);
|
console.debug(`AutoSet ${streamType} - Previous was ${prevStream.Index} - ${prevStream.DisplayTitle}`);
|
||||||
|
|
||||||
let prevRelIndex = 0;
|
let prevRelIndex = 0;
|
||||||
|
@ -2284,12 +2294,22 @@ class PlaybackManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoSetNextTracks(prevSource, mediaSource) {
|
function autoSetNextTracks(prevSource, mediaSource) {
|
||||||
if (!prevSource
|
if (!prevSource) return;
|
||||||
|| typeof prevSource.DefaultAudioStreamIndex != 'number'
|
|
||||||
|| typeof mediaSource.DefaultAudioStreamIndex != 'number'
|
if (!mediaSource) {
|
||||||
|| typeof prevSource.DefaultSubtitleStreamIndex != 'number'
|
console.warn('AutoSet - No mediaSource');
|
||||||
|| typeof mediaSource.DefaultSubtitleStreamIndex != 'number')
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof prevSource.DefaultAudioStreamIndex != 'number'
|
||||||
|
|| typeof prevSource.DefaultSubtitleStreamIndex != 'number')
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (typeof mediaSource.DefaultAudioStreamIndex != 'number'
|
||||||
|
|| typeof mediaSource.DefaultSubtitleStreamIndex != 'number') {
|
||||||
|
console.warn('AutoSet - No stream indexes (but prevSource has them)');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rankStreamType(prevSource.DefaultAudioStreamIndex, prevSource, mediaSource, 'Audio');
|
rankStreamType(prevSource.DefaultAudioStreamIndex, prevSource, mediaSource, 'Audio');
|
||||||
rankStreamType(prevSource.DefaultSubtitleStreamIndex, prevSource, mediaSource, 'Subtitle');
|
rankStreamType(prevSource.DefaultSubtitleStreamIndex, prevSource, mediaSource, 'Subtitle');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue