[gstreamer-bugs] [Bug 372797] Seek on DVD not performed relative to title
GStreamer (bugzilla.gnome.org)
bugzilla-daemon at bugzilla.gnome.org
Sat Nov 11 14:31:42 PST 2006
Do not reply to this via email (we are currently unable to handle email
responses and they get discarded). You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=372797
GStreamer | gst-plugins-ugly | Ver: 0.10.4
------- Comment #8 from Jason Gerard DeRose 2006-11-11 22:30 UTC -------
Again, the big problem with dvdreadsrc currently is that it doesn't properly
handle cases where the title_set has more than one title. Here's a summary of
how things work with libdvdread, as far as I understand:
* The title number is mapped to the title_set number with
tt_srpt->title[title].title_set_nr
* For feature movies, the feature title is usually the only title in its
title_set, which is why dvdreadsrc generally worked. But for, say, TV serials
with several episodes per DVD, all the episodes usually belong to a single
title_set, including the "play all" title that many DVDs have. In these cases,
dvdreadsrc is "super extra broken".
* ifoOpen and DVDOpenFile take the title_set_nr as an argument; they always
open a title_set, not a single title (although as above, for movies the feature
title is usually the only title in the title_set).
* DVDReadBlocks works relative to the title_set, not the title. A wrong
assumption made in many places in dvdreadsrc is that a title always starts at
sector zero. In fact, it seems this assumption can't even be made for a
title_set with one title.
* cell_playback[cell].first_sector and cell_playback[cell].last_sector are
relative to the title_set, not the title. This is why, by chance anyway, a
multi-title title_set would at least start playing the correct title for title
> 0.
* If a title_set has a vts_tmapt, it will have exactly one tmap per title in
the title_set. As far as I can tell, (tt_srpt->title[title].vts_ttn - 1) gives
the index for the correct tmap for the title, but I need someone to verify
this.
* The times in the tmap are best dealt with relative to the title (which is
what we want to do), but the sectors in tmap.map_ent[] are relative to the
title_set. This "just works" as long as you are using the correct tmap. In
this respect, gst_dvd_read_src_get_sector_from_time() was horibly broken. The
original author(s) thought a nested iteration through
vts_tmapt->tmap[i].map_ent[j] would somehow give the correct sector, which is
utterly wrong, not to mention silly. It seems they got the idea from
ifoPrint_VTS_TMAPT(), but didn't take the time to understand the meaning of the
data structures. This is part of the reason why seeking is so broken.
I have finished a patch that fixes the most glaring title/title_set problems.
On large seeks there is still some problem with gst_dvd_read_src_read() and/or
gst_dvd_read_src_create() getting caught in an infinite loop and the seek never
completing, but I'll look into that later (my patch didn't introduce this
problem... it was already happending).
Here is a summary of the patch:
* Fix gst_dvd_read_src_get_sector_from_time()
* Use the correct tmap only instead of iterating through them. I still
need someone more familiar with libdvdread to verify that
(tt_srpt->title[title].vts_ttn - 1) does indeed always give the index for the
correct tmap.
* Use "advanced algebra" to select correct map_ent instead of silly
iteration.
* Fix title starts at sector zero assumption in gst_dvd_read_src_goto_sector().
* Fix title starts at sector zero assumption gst_dvd_read_src_goto_chapter().
--
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email
More information about the Gstreamer-bugs
mailing list