Fixes to VobSub subtitles loading #1505

merged 2 commits into from Jul 2, 2014


None yet
6 participants

anssih commented Sep 29, 2012

The first commit fixes manual loading of VobSub subtitles, while the second, larger commit moves the matching of .idx/.sub files to happen earlier in the autoloading process to avoid several pitfalls. The commit log entries contain more detailed information.

Comments welcome, especially regarding the second commit and the SubFile and SubFileList there in Util.h (not sure if it is preferred to do that in some other way).

@ghost ghost assigned anssih Sep 29, 2012


anssih commented Sep 29, 2012

@taxigps, you were previously involved with VobSub stuff, mind giving your two cents and/or testing? :)


MartijnKaijser commented Oct 11, 2012

Go for merge?


anssih commented Oct 11, 2012

Sorry, been too busy for the last week or so. I think the second commit could probably be changed to what taxigps suggested, but I have to test it first to be sure. I'll try to do that this week.

@ghost ghost assigned elupus Feb 3, 2013


ghost commented May 4, 2013



elupus commented Aug 4, 2013

ping, still valid and useful?


anssih commented Sep 19, 2013

Oops, possibly. Will take another look in the next two weeks, honest!


anssih commented Oct 13, 2013

From what I can see, taxigps' suggestion is OK, so I can change the second patch to that. I'm sure I had some reason to do it like I did, but I think that must've been theoretical (or simply wrong) since I'm not finding any samples that don't work with the simpler version.

I'll update the first patch to also work with zips, and re-test and re-confirm everything.


da-anda commented Jan 22, 2014

is this fix still required?


mkortstiege commented Jun 23, 2014

@anssih what's the status here?

anssih added some commits Sep 29, 2012

Fixed: Manual loading of VobSub subtitles
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.
Fixed: Subtitles autoloading with both VobSub and MicroDVD files
For example, this directory structure:
- movie.mp4
- 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.

anssih commented Jun 29, 2014

Updated, finally. Sorry all for forgetting about this multiple times, and thanks for the pings.

Trivial updates to first patch plus CStdString => std::string, second patch replaced with a simpler version suggested by @taxigps.

I still think this stuff could use some cleanup, including moving to somewhere else from Util.cpp and minimizing code duplicated across players. The previous version of the 2nd patch ( anssih/xbmc@2176021 ) had some changes to address the latter point, but it would require some refactoring as some things could be done even better so I'll leave that until later to get this PR finally done.

jenkins build this please


jmarshallnz commented Jul 1, 2014

Looks good. Agreed it can be cleaned up further later: If you happen to have a subs rar inside a main movie rar, then things can get really, really slow as it iterates through all the possible combinations...

jenkins build this please


jmarshallnz commented Jul 2, 2014

jenkins build this please


jmarshallnz commented Jul 2, 2014

jenkins seems no-worky (PR too old?) - merging anyway...

jmarshallnz added a commit that referenced this pull request Jul 2, 2014

Merge pull request #1505 from anssih/fix/vobsub-load
Fixes to VobSub subtitles loading

@jmarshallnz jmarshallnz merged commit ef3ac86 into xbmc:master Jul 2, 2014

@MartijnKaijser MartijnKaijser modified the milestones: Helix 14.0-alpha1, Awaiting answer from dev Jul 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment