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

Jeremy Drake mplayer at jdrake.com
Sun Dec 17 21:33:46 CET 2006


On Sun, 17 Dec 2006, Nico Sabbi wrote:

> Jeremy Drake wrote:
> > On Sun, 17 Dec 2006, Nico Sabbi wrote:
> >
> >
> > > today I've been busy with the output stream patch; tomorrow I'll look into
> > > this seeking issue
> >
> >
> > I created a function:
> > int tivo_stream_seek(stream_t*s, off_t pos)
> > {
> > 	demuxer_t* demuxer = ((demux_stream_t*)s->priv)->demuxer;
> > 	return stream_seek(demuxer->stream, pos);
> > }
> >
> > And set s->seek = &tivo_stream_seek after new_ds_stream, and now I can
> > seek (sort of, seeking backwards has some issues, don't know why).  I
> > noticed that new_ds_stream does not set a seek function, so I set one
> > myself.  I don't know that this is an acceptable fix, it seems hackish to
> > me, but it helps.  Hopefully this nugget will help you find the real fix.
> >
>
>
> seeking in piped demuxers is very tricky.
> The attached patch works for me, but I don't really like it.

Eww.  Two things in particular make this unattractive to me:
1. It hacks demux_mpg.c, which means that it would require hacks in each
demuxer that anyone wanted to use like this
2. It requires me to deal with the times myself.  I don't currently try to
pull out the timestamp stuff from the MPEG, and I'm not even completely
sure how.

ISTM that plugging into the seeking of the stream would make more sense,
since this is what all demuxers currently use, and the stream seeks deal
in nice, easy-to-use bytes rather than difficult-to-convert seconds.  The
other demuxer already needs to know about such things to work stand-alone,
I say let it handle the conversions ;)

> Anyone feel free to improve it ;)

If I had a better understanding of the code...  I may try to fix up my
seek function some to get it to behave better.  I am thinking I may need
to flush something somewhere... Is there something to flush out whatever
may currently be pending in the stream I add packets to?


-- 
When you don't know what you are doing, do it neatly.



More information about the MPlayer-dev-eng mailing list