Currently VobSub (.idx/.sub) subtitles can not be loaded manually.
Allow loading VobSub subtitles manually by specifying either the .idx
or the .sub file. The other file is detected automatically. The
following naming schemes are supported:
- foobar.idx and foobar.sub
- foobar.idx and foobar.(rar|zip) containing foobar.sub
All of the above can be inside an archive (commonly .rar) as well, in
which case the user can select either .idx or .rar inside the archive.
For example, this directory structure:
- movie.sub (MicroDVD subtitles)
- Subs/movie.rar (VobSub subtitles)
will prevent any subtitles from being actually loaded. DVDPlayer calls
IsVobSub() for any added .sub files to check if they should be ignored
(since VobSub files are supposed to be added via .idx during
autoloading, we do not want to add them a second time via .sub). In this
case IsVobSub() actually returns true even for the MicroDVD subtitles
since movie.rar contains movie.idx, which matches the name of the
MicroDVD subtitle file. Additionally, the movie.idx inside movie.rar
will actually be paired with the MicroDVD movie.sub instead of the
correct VobSub movie.sub, and will therefore fail to load.
To fix this, make the VobSub .idx/.sub pairing requirement more strict,
allowing a match only if they are in the same directory (or, as
previously allowed, .sub is rarred/zipped in an archive matching the
name of .idx).
Suggested by taxigps.