[MPlayer-dev-eng] .TiVo file support (fwd)

Jeremy Drake mplayer at jdrake.com
Sun Dec 17 00:49:59 CET 2006


Got my emails back, but now I get 3 copies of all emails.  Better than
none, but I would prefer one copy of each... ;)

On Sat, 16 Dec 2006, Nico Sabbi wrote:

> Jeremy Drake wrote:
>
> >
> > No, the signature is at the beginning of the file.  Other than the header,
> > it looks exactly the same as an MPEG file.  Could I call the probe func
> > for mpeg too?  Is that a good idea?
>
> no

Than I don't really know what else to do for this...

> this is true; you can fill the packet while(n<dp->len)

Thought so.

> >
> > > dp->pos is set in new_demux_packet()
> >
> >
> > I don't like to trust initialization, but I took that out... ;)
>
> you had better trust it

I mean, I don't trust other code to initialize things for me, I tend to
always do it myself just to be sure.  Unless it is clearly and strictly
defined that this will be initialized to zero, I don't like to rely on
undocumented postconditions.

> > I did it the easier way, which was to tack any of the stuff I would have
> > done the 1 byte stuff with at the beginning of the packets that were
> > handled.

I still call resize_demux_packet each time, because this seems to be the
correct way to set the length of a packet before adding it to the stream.
That's another thing I don't trust, is modifying people's member variables
out from under them when a function to do whatever task is defined.
Something I picked up from my C++ schooling, I guess...


I would appreciate any suggestions for seek functionality and for getting
the progress bar correctly knowing how far into the file I am.  I thought
that was what dp->pos was for, but apparently I was proved wrong.  How
then do I get it to know where I am?  And where the end is?  It would be
very nice to seek, but at the moment the contents of MPEG packets are
opaque to me for the most part, and as I understand it to write a real
bona-fide seek function I would need to find pts timestamp things from the
packets and bitrates and things which up to now my code has no need to
figure out.  Would be really nice to leverage the existing mpeg code for
this, as the format of the file past the special header is completely
compatible with standard MPEG files (I think TiVo did this on purpose to
make their lives easier with their MPEG codec hardware).

-- 
Whatever became of Strange de Jim?  Well, he found a substitute for
cocaine: "You cover Q-tips with sandpaper and ram them up your nostrils
as far as they will go.  Then you sniff talcum powder while shredding
hundred dollar bills."
		-- Herb Caen



More information about the MPlayer-dev-eng mailing list