
Originally Posted by
AlphaWolf
Detect if the tystream is scrambled by checking the first four bytes of each tystream part. If its unscrambled, the first four bytes will be: 0xF5467ABD. Anything else will be a scrambled stream. The purpose of doing this is that you don't need to include the CommercialSkipOffset attribute, that way when you insert it into another tivo, it will play it back whether the tivo is in noscramble mode or not. (including CSO makes the stream fail in scramble mode)
Also, if you want to keep scrambled recordings workable from a dead tivo hard disk, you might want to include a means of getting the /State/Media.DiskConfiguration attribute (you can include it in the TMF's XML data outside of the normal object tags, whatever reads the TMF can decide what it wants to do with it from there, be that to ignore it or whatever else.)