[MPlayer-dev-eng] .TiVo file support

Jeremy Drake mplayer at jdrake.com
Thu Dec 14 23:06:12 CET 2006


On Thu, 14 Dec 2006, Nico Sabbi wrote:

> Jeremy Drake wrote:
> > I put my current work in the tivodecode cvs
> > (http://tivodecode.cvs.sourceforge.net/tivodecode/mplayer_demuxer/).  It
> > can be checked out through the normal sourceforge method.
> >
> > On Wed, 13 Dec 2006, Nico Sabbi wrote:
> >
> >
> > > too weak and prone to false positives
> >
> >
> > Any suggestions as to what to do instead?
>
> search at least 4 of them in not much space

4 of what?  I don't understand.  There are not 4 FOURCC values in a row.
I could try reading in the file header completely and see if it makes
sense, but I'm not sure how much of it I can verify because the entire
format is reverse engineered, so I don't know exactly what values where
are normal...

> I didn't notice this 1-byte stuff. It sucks indeed.
> buffer the byte read in dp->buf+dp->pos until you don't have
> any more space

So did I misinterpret the meaning of dp->pos?  I thought it was for the
position of the packet in the stream.  Does it really mean where I am in
the buffer, and as such its value is irrelevant to whomever gets the
packet?

So in a pseudo-code kind of thing,
while not eof
 make new packet
 dp->pos = 0;
 foreach byte while dp->pos < dp->len
  dp->buf[dp->pos++] = byte;
 ds_add_packet(...)

With the handled parts put in packets by themselves already, when I find
one put in the buffered data and start over after, or should I try to
concat it into the same packet with the buffered stuff?  In other words,
should I try to keep MPEG packets in one piece in a packet, or should I
try to optimize filling the mplayer packet to 2k ignoring the MPEG packet
boundaries?


> > Good.  Now I need some help with the seek and control functions.  They
> > should be able to behave like the MPEG ones, at least at first.
>
> seek() should already work with piped demuxers, but control() ones don't. It
> needs to be implemented from scratch, but you can leave them
> alone for the time being

As written, I cannot seek().  Is there something I need to do?  Do I need
to put in a seek function in the info struct, and hand off to the MPEG
seek somehow?

The current code is at
http://tivodecode.cvs.sourceforge.net/tivodecode/mplayer_demuxer/demux_tivo.c?view=markup

I also added a close function since I emailed it to the list.

-- 
	The people of Halifax invented the trampoline.  During the
Victorian period the tripe-dressers of Halifax stretched tripe across a
large wooden frame and jumped up and down on it to `tender and dress'
it.  The tripoline, as they called it, degenerated into becoming the
apparatus for a spectator sport.

	The people of Halifax also invented the harmonium, a device for
castrating pigs during Sunday service.
		-- Mike Harding, "The Armchair Anarchist's Almanac"



More information about the MPlayer-dev-eng mailing list