xbmc/xbmc — pull request #1348 by SlrG (2012-08-31 19:43:38+00:00)
Title: FIX: Add HD DVD detection and handling for HD DVD specific external play...

Using an external player for HD DVD discs at the moment fails, because the player is called again and again in what seems to be an endless loop.

Simple reason is, that it is called for every single *.evo file on the disc, while it should be one time only.

This fix checks inserted discs for *.xpl or HV*.ifo files (see: http://www.dvdafteredit.com/wiki/HD_DVD_Structure) and calls the external player once.

*.xpl files inside of an ADV_OBJ folder are HD DVD playlists on discs with so called "Advanced Content". Every single disc I own has them. It seems this is the most common disc type. As XBMC isnt't able to handle these files, the best is to hand them over to an external player.

Discs with only a HVDVD_TS folder and no ADV_OBJ folder seem to be less common. In the HVDVD_TS folder there may be HV*.ifo files. They contain Video Manager, Standard Title Set or Advanced Tile Set information. Stuff that is again handled best by an external player.

So if one of these filetypes is present, a single external player call is initiated, using the name of the found file. This has advantages and drawbacks.

Advantage is, that in theory the user will be able to use different external players for the two filetypes.
Drawback is, that in this case two external player rules will be needed.

The rules could be as follows:

Using only the first rule will be sufficient in most cases I guess.

If no rule is defined by the user, or no *.xpl or HV*.ifo files are present, the internal player will be used to playback the *.evo files, like it did before.

RE: // ToDo: add logic to identify main movie
This means the fix might be enhanced in the future to improve the order the internal player handles the *.evo files. At the moment they are sorted alphabetically which often plays very small files like menus, trailer et cetera before the main movie. I tried sorting by size, but this doesn't work for all discs. Sadly the biggest file is not always the right start of the main feature. I'm still experimenting on this.