The usual combination of a zero-based index and a lazy if...
Also, there is no reason to use the default subtitles after asking users which subtitles they want.
It's a zero based index, so if the first entry is not the default language, you can't ever select it.
Probably related to https://github.com/jellyfin/jellyfin-kodi/issues/265
PS: It's my first time messing with code on github. Sorry, if I didn't follow protocol correctly.
* fix bug where subtitle streams that don't support external streaming
would show up in video player OSD selection as external when transcoding
(e.g. embedded PGSSUB)
* fix bug where EnableSubtitleExtraction server setting wasn't taken
into consideration when transcoding
* Override VideoBitrate option in transcoding url (previously calced in backend)
* Use manual AudioBitrate when user has track selection dialog disabled
* Fix bad loop-and-remove
* Redo max. bitrate options, add more bitrates in the lower end
* Remove SD/HD from the bitrate strings as the quality doesn't match up to what the backend selects (e.g. 1.3 Mbps definitely wasn't HD)
* Add option to force transcode mpeg2
* Add option to choose between h264 & h265 as a preferred codec for transcoding
* Add option to select preferred audio codec for transcoding/directstream
* Add option to select audio bitrate when transcoding (previously hardcoded to 384kbps for >2.0ch & 192kbps for <=2.0ch)
* Add option to select max audio channels (e.g. for server-side downmix)
* Add option to hide embedded/internal & picture-based subtitles in the track selection dialog
* Capitalize language in the track title
* Capitalize channel layout in the track title (e.g. 'Stereo')
* Remove track index from the title - users generally don't care what
the # is
* Use commercial names for the audio codecs (e.g. 'Dolby Digital'
instead of 'ac3')
* Always show codec name for subtitle tracks