[DVDnav-discuss] Suggesting new method to accurately set position by time

gnosy gnu gnosygnu at gmail.com
Wed Jun 9 02:53:25 CEST 2010


Hi all.

First, some background about me. I am very new to open-source project
contribution. So, my apologies in advance for any inexperienced gaffes in my
tone or approach.
Also, I sent an earlier version, but apparently it was too large and needed
moderator approval. Please ignore if you get it again.

While working with VLC I noticed that libdvdnav does not accurately handle
setting position by time.
Specifically, there are two methods that seem to address this functionality,
but both have issues:
1. dvdnav_time_play in navigation.c
    This is not implemented, so it is not usable.
    printerr("Not implemented yet.");

2. dvdnav_time_search in searching.c:
    This function uses interpolation over a cell to get to a time, which is
inaccurate. The comment indicates as much
 /* FIXME: right now, this function does not use the time tables but
interpolates
   only the cell times */

With that in mind, I decided to try to implement an accurate method. As it
turns out, this is not a trivial issue.

I came up with an approach that does seem to work, but with a few
reservations:
- the approach is a bit complicated
  It uses VTS_TMAPTI and VTS_VOBU_ADMAP to get to time. I detail more below.
- the approach may fail on poorly-authored dvds
  If a DVD has a corrupt VTS_VOBU_ADMAP it will not work

I detail more in this thread:
http://forum.videolan.org/viewtopic.php?f=32&t=76308&start=15. I am
reposting my last post below. It is verbose, but hopefully it explains the
situation

Finally, I will send my version of searching.c in a follow-up email. It has
a new method: static int32_t dvdnav_jump_to_sector_by_time(dvdnav_t *this,
uint32_t time_in_pts_ticks);

I send it for curiosity/review purposes. If this new proc is acceptable, I
will convert to the preferred patching-method for libdvdnav. (I am honestly
ignorant of what is involved)

Also, please note I am also very new to C programming (I am a C# programmer
with some Java). My apologies in advance for the verbose
comments/printfs/lack of convention.

Let me know if there is anything else.
Thanks.

----EXCERPT FROM THREAD----
I used to use the MS DirectDvd library. I believe it's the same library that
Windows MediaPlayer uses (the behavior is exactly the same).
It does accurate seeking for most dvds, but there are some DVDs (< 5%) that
it will fail and give a Division by Zero error (it will freeze the app).
By my best analysis, I think DirectDVD uses the timestamps in the VOB PCI
pack (c_eltm?) http://dvd.sourceforge.net/dvdinfo/pci_pkt.html. It doesn't
seem to use the IFO at all.



More information about the DVDnav-discuss mailing list