xbmc/xbmc — pull request #5414 by Voyager1 (2014-09-26 07:28:56+00:00)
Title: VobSub fixes

This PR solves a variety of issues when using external vobsubs, especially in combination with external SRT.
I came across the issue when trying to load vobsubs and my preferred language was actually in an SRT, and it was a total mess...

Issues resolved:
- SRT is now equally prioritized, and gets a chance of being selected if it has the preferred language
- when switching from SRT to SUB there was a change in order and indices due to the "source" value not being set (STREAM_SOURCE_NONE) in the VOBSUB demuxer. This caused the selectionstreams to be cleared and reloaded. The result was that between saving the subtitle index to the settings db and resuming the video another subitle got selected! Setting the source value upon demuxer opening and stream creation, resolved this issue.
- the code has a couple of instances where it assumes that a VOBSUB contains only one subtitle, whereas in practices there's more than one. The fact of filename2 not being set also caused re-opening the streams unnecessarily. Also only one of the streams was named xxx (External) and they are now all marked (External).
- there was an issue whereby the .sub file is rar'ed and the stream-details-parser tries to analyse the filename as embedded within the rar. If just the archive name has the same name as the movie, but not the embedded file, this doesn't work correctly.

@ace20022 - this is one for you to review