first of all, i would like to say that i am no professional programmer whatsoever, my code is far from perfect, and this is the first thing i coded that i actually find useful. second, i would like to thank mxm (especially benjeremy) and unleashx for porting the unrar library by eugene roshal and making in publicly available.
the patch is on sourceforge:
http://sourceforge.net/tracker....=581840
check the readme.txt for instructions.
this patch does: add unrar functionality to the cachesubtitles method.
if a idx/subtitle is found, it is copied to the alternate subtitles directory and then extracted there. this is done because this unrar library does not work directly from cd and possibly network.
after it is extracted (the whole process takes about 5 seconds for a 15 mb .sub file, which is acceptable i think, but there is still alot of room for improvements), it gets loaded normally.
the .idx/.sub are not deleted from the alternate subtitle directory when you finished the movie, in case you want to watch the movie again, there is no need to unrar it again, so you save about 5 seconds
you can still delete them manually with the filemanager if you feel like it.
current limitations / bugs:
it only works for filenames <= 42 chars (fatx limitation). - this should not be a big problem to fix.
it only works if the .sub filename inside the rar file also corresponds to the movie filename. - this shouldn't be too hard to fix either.
it does not work for very big subs (below 20 mb .sub file should not be a problem). this is not the problem of the unrar process, e.g. a 37 mb .sub file gets extracted successfully, but xbmc runs out of memory when trying to load it. i think this was fixed in a previous version of xbmc but now doesn't work anymore.
i don't know what happens or even bigger subtitles (50mb+, which would be more than the free memory before playing a movie). it probably can't even extract it then.
and yes, it does work for winrar 3 files.
post bugs and other issues here or in the sourceforge patch tracker.
update:
i fixed the first 2 issues, it now works for any filenames, and it also works if the .sub inside the rar doesn't have the same name as the movie.
i also tested a 100mb .sub file (compressed it was 20mb), it was extracted successfully (copying rar/idx from smb and then extracting took about 30 secs), however xbmc couldn't load it after that.
i hope butcher can fix that again, as i didn't really look at that part of the code (and don't really have the time or knowledge either). once we get that fixed, we have full unlimited support for vobsubs
and btw, i forgot to mention in the instructions, that you need to change the dependencies in the vc project (project -> project dependencies) and make xbmc dependant from unrarxlib. otherwise unrarxlib isn't recompiled / relinked when you make changes to it.
i will post another patch on sourceforge once i cleaned up the code a bit (right now it is a mess as usual).