Filesystem support for .rar
#16
no rar browsing yet but it shouldn't be too hard to add. will try to look into the directory code. another thing worth thinking about: it may be beneficial to make the crarmanager a global since right now, each crarfile uses a local copy of a crarmanager so each cfile dtor() and each call to delete() and rename() cleans up cached files and so multiple calls may sometimes lead to too much uncaching/caching if you don't care to set the autodelete flags appropriately. this is just a performance issue that could affect very large rars; a global cache would be easier to manage but i'm not sure it's worth adding another global and things seem to work fine right now. have just streamed rarred cdgs from network.
Reply
#17
i tested the new code (again only the subtitle part), and the good news is, uncompressed vobsubs work again Smile
it still doesn't work for rarred vobsubs though. first, there is a small bug, but you probably couldn't know that if you don't use vobsubs. with vobsubs you usually have the .idx file (txt) uncompressed, together with the compressed (rar) .sub file (binary), so 2 seperate files. like it is now, the function cachesubtitles terminates when it finds the .idx before it actually reaches the cacherarsubtitles part. i just commented out the "if (bfoundsubs) return;" statements for testing purpose.
however, i can't explain why it still doesn't work. the .idx and the .sub are now correctly cached to z: (the log doesn't say anything about the .sub file, but it is present on zSmile. but the movie doesn't start. xbmc still runs fine after that though.
looking at the code, i think something should be logged, so probably the error is somewhere near the log output in the cacherarsubtitles function.
from the log:
Quote:04-12-2004 15:14:20 info mplayer play:f:\movies\test\test.avi cachesize:1024
04-12-2004 15:14:20 info cached subtitle f:\movies\test\test.idx->z:\subtitle.idx
04-12-2004 15:14:20 info unrarlib_get started
04-12-2004 15:14:21 error cmplayer::openfile() f:\movies\test\test.avi failed
everything works fine though withe the same files if the .sub file is uncompressed (unrarred). do you have any idea what's happening there at all? or can someone else test it
Reply
#18
damn! i forgot that it worked only when the clog in cacherarsubtitles was commented. just try commenting that clog and it should work. will fix all this in the next upload. thanks for the feedback.
Reply
#19
you're right, it works when outcommenting the clog line. this might be because you used cstdstring types instead of standard c strings. i didn't test it yet, but i guess
clog::log(loginfo, " cached subtitle %s->%s\n", strpathinrar.c_str(), strdestfile.c_str());
instead of
clog::log(loginfo, " cached subtitle %s->%s\n", strpathinrar, strdestfile);
should work.
Reply
#20
you were right sergej, the problem was not using c_str(). i don't really get why i can't use a cstdstring as a clog argument though, it compiles fine and from the cstdstring docs:
Quote:it provides an implicit conversion operator lpctstr(), just like cstring, so you don't have to call c_str() all the time. ansi may not like this, but i sure do.
doesn't this mean i can substitute a cstdstring for a const char*? anyways, uploaded a new patch fixing this and changed the caching so that uncompressed idx now works with compressed sub. let me know if there are any other issues.
Reply
#21
ok, this isn't really the right thread to post it, but i just tested the new mplayer.dll with the latest cvs checkout, applied stcogoli's patch (i used the old cachsubtitles method, didn't have time to rewrite the new one).
the results are very nice. it takes less than half as much time to start a movie with vobsubs, and my test movie with a 37 mb .sub file worked flawlessly too. it always crashed before. and with the patch, rarred vobsubs work fine, too.
only one subtitle didn't work, i dunno if it worked in earlier versions though. works fine with dvobsub on pc. the weird thing is, it is only one language (english) that doesn't work, portuguese and spanish work fine...
Reply

Logout Mark Read Team Forum Stats Members Help
Filesystem support for .rar0