xbmc/xbmc — pull request #584 by CrystalP (2011-12-26 19:40:29+00:00)
Title: Fix crypted dvd playback

Playing encrypted dvds from home page or context menu->Play Disc doesn't work.
That happens at least in Windows, for master and Eden beta.
I'd appreciate to know if this also happens on linux and OSX and whether the PR helps or if it's not necessary.

This happens because libdvdnav (and in turn libdvdcss) receive a more complete file path since recent changes in the playdisc functions.
It used to receive something like H:, which worked, but now receives H:\VIDEO_TS and lidvdcss fails.

I see three solutions:
- change the play discs function to pass the drive path again
- extend the truncation done in CDVDInputStreamNavigator::Open().
- patch libdvdnav or libdvdcss.

This PR implements the least intrusive change: a more thorough truncation of the file path.
It might be better to truncate video_ts\video_ts.ifo in one step instead of truncating video_ts.ifo, then video_ts, I'm not sure.
This works correctly for dvds, iso and ripped video_ts folders.