Re: C++=>C comment, forgotten file

H}kan Hjort <[email protected]>
Newsgroups gmane.comp.video.ogle.devel
Message-ID <[email protected]>
Fri Dec 27 2002, Martin Piskernig wrote:
> On Friday 27 December 2002 20:14, H}kan Hjort wrote:
> > I'm going to try to do some work on libdvdread now this weekend.
> 
> It would actually be *very* nice if you could make some thoughts about the 
> timecode-seek feature (DVDTimeSearch) if your time permits :-)
> 
Well that has so much to with libdvdread really (more than making sure that 
all the needed info is exprted, and correctly so).

> vlc and mplayer both have support for a slider. I tested it and it's
> working, but in the libdvdnav code it is not very clear to me how
> they do it so I could not port it to ogle...
> 
> My idea is to first find the cell which contains the timecode (quite
> trivial) 

There should already be code to do aproximatly this, for the PTT/Chapter
information retrival. 

> and then do a "sub"search in this cell and jump to the
> wanted block with the fwda[n] pointers or calculate the right block
> number in the cell containing the exact timecode. There are some
> comments in the nav.c code for DVDTimeSearch, could the one who
> created the comments please explain to me how he planned to get it
> working? :-)

That would be my comments ;)

For all the parts that one are supposed to be able to do time seeks in
there is a 'Time Search table' for.  it's only for parts where the
people how masted the DVD didn't intend one top be able too seek where
the more complicated method would be needed.
Or when you want more precision than the 'Time Search table' gives you.
The table basicly looks something like this:

Time Search table
-----------------
Number of VTS_TMAPS: 1
Last byte: 6311
TMAP number 1 has offset 12 relative to VTS_TMAPTI
TMAP 1
  Time unit (seconds): 4
  Number of entries: 1574
Time:  0:00:04  VOBU Sector: 0x000005d5 
Time:  0:00:08  VOBU Sector: 0x00000d66 
Time:  0:00:12  VOBU Sector: 0x000015c1 
...
Time:  1:44:48  VOBU Sector: 0x002f1354 
Time:  1:44:52  VOBU Sector: 0x002f1b14 
Time:  1:44:56  VOBU Sector: 0x002f228a discontinuity

So here we see that there is one time seekable title.
The table list the VOBU offset once each 4 seconds and there are 1574
entries.. then the rest is just math ;)

There are a few ways to do the more general seek code, VOBU address
maps, linear interpolation, bitrate estimation, the FWDA / BWDA
offsets...  It might be a bit more trouble when you get to interleaved
VOBUs (multiangle or just interleaved allocation).

A bit of the reason that this has been put of is that it need
cooperation with the GUI or one will not have any sensible way to
input the time to seek to.

Anything in particular you'd like to do?  I think it would be
best/easiest to try to make the interface (dvdcontrol) work first with
seeking using the 'Time Search table' and then when that is working
possibly extending it to have alternative methods of seeking (when
there is no 'Time Search table').  Have you looked at the interface in
dvdcontrol?  Does it look ok?  It's based on some other interface and
might not be exactly what we want, please make suggestions, easiuer to
change it now than later when it's used.

I've lots of changes to libdvdread pending rigth now, adding some
small features which have broken stuff, I need to break it down and
check them in one by one (or find the bug some other way) before I can
start to tackle the seeking code.

-- 
Håkan Hjort
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.