Splitstream and constant sequence issues

keary@m... keary at m...
Fri, 19 Oct 2001 04:13:25 -0000


I'm not sure this will help, but I figure I will throw it out there.

In looking around at the Tivo TCL scripts and TivoWeb TCL scripts, I 
noticed there is a command "mfs streamsize <FSID>". This command 
returns three numbers:

1. The record size (always 0x20000 as far as I can tell)
2. The number of records allocated for this stream
3. The number of record ACTUALLY USED in this stream

Now looking around at all of my streams, the actually used number is 
almost always 1 less than the number allocated. (Except for the final 
stream in a Showing. It is sometimes alot less).

Maybe if ExtractStream used the third number, it might have better 
luck getting only the correct stream data. I can't get a tivo cross 
compiler going yet (having trouble making it on Cygwin.. Any help?) 
but currently ExtractStream uses (buffer+(i<<3)+0x3c) as the start, 
and + 0x40 as the length. Maybe the used length is at 0x44?

A couple of other notes. I do have one stream where the used length 
is 0 (in a stream that plays fine on Tivo). I am assuming this 
means "entire stream filled." The other note is that the other thing 
to try is instead of modifying ExtractStream, is just modify 
SplitStream to take additional arguments representing the "allocated" 
length and "used" lengths of the original streams, and have 
SplitStream "ignore" the inbetween chunks. I think you probably need 
to use ExtractStream output from DUMP_OUT and not -s, because -s 
skips those 0xf5467abd chunks which would screw up the counting.

To get the allocated and used lengths:

>From /tvlib/tcl/tv

bash# tivosh
% source fsdir.tcl
% RetryTransaction { FileSize tyStream <FSID> }
..will output something like 131072 x 4096(4095)
where 131072 is the chunksize (0x20000), 4096 is the allocated 
chunks, and 4095 are the used chunks...
% exit

FileSize and tyStream are actual words, and <FSID> is the fsid of the 
stream you are interested in.

Hope some of this helps. I have been having quite a bit of fun for 
the last few days (got the TivoNet card last week.)