Seek on DVD not performed relative to title

Bug #71017 reported by Jason Gerard DeRose
8
Affects Status Importance Assigned to Milestone
GStreamer
Expired
Medium
gst-plugins-ugly0.10 (Ubuntu)
Confirmed
Low
Jason Gerard DeRose

Bug Description

I'm running under Edgy, using gstreamer0.10-plugins-ugly-0.10.4-0ubuntu3.

With totem-gstreamer, if I do something like this:

  totem dvd://2

And then seek, I will get bumped back into title 1. Also, if I do a large seek (say 30 minutes or more), sometimes totem will hang and never complete the seek. I know this isn't a totem bug because I have the exact results with the player in the gstreamer-based DVD ripper I've been developing.

Thanks!

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

I've filed an upstream bug about this: http://bugzilla.gnome.org/show_bug.cgi?id=372797

I know what the problem is and am working on a patch. I'd don't know quite how the updates policy works for universe... will it be possible to get a fix for this into Edgy?

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

I've submitted a patch for this upstream, but it was written starting from what was in cvs. http://bugzilla.gnome.org/show_bug.cgi?id=372797

I'll test a patch for Edgy and then submit that too.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

After reading https://wiki.ubuntu.com/StableReleaseUpdates I expect that this is not a fix that would be allowed into Edgy anyway, but I'll still put a patch together.

After working on the dvdreadsrc element quite a bit, I started to become frustrated with its readability problems and general cruftiness, so I've started a rewrite from scratch. I have the code for my new element in a Bazaar repository at https://launchpad.net/people/jderose/+branch/kungfu/dvdsrc

My new dvdsrc element is now mostly usable as a drop-in replacement for dvdreadsrc. Currently I'm trying to decide whether it makes sense to combine the functionality of dvdnavsrc and dvdreadsrc. My feeling is that is probably does make sense, and so I'm planing to add Nav support to my new element. My goal is to trying to get this finished in time to get it into Feisty, so that full DVD functionality is available under gstreamer0.10.

I could definitely use help on this, if anyone is interested!

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Here is the patch. In summary, it:

* Fixes gst_dvd_read_src_get_sector_from_time(). Now only the correct tmap is used instead of the silly iteration through all tmaps in the title_set.

* Fixes title starts at sector zero assumption in gst_dvd_read_src_goto_sector().

* Fixes title starts at sector zero assumption gst_dvd_read_src_goto_chapter().

I've testing this under Totem, Thoggen, and KungFu, and have found no regressions.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Oh, the patch also:

* Improves gst_dvd_read_src_get_time_for_sector(), which now only iterates through the correct tmap instead of every tmap in the title_set.

My gstreamer bug report has all sorts of details about my progress on this bug, some of which was wrong at first, but here is the most important bit:

"""
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
> 1.

* 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. (** After testing this on lots of DVDs, I'm now very confident that this is correct. **)

* 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.
"""

Changed in gst-plugins-ugly0.10:
assignee: nobody → jderose
status: Unconfirmed → Fix Committed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for the work on that. You are right about Edgy, that patch would not be a candidate for a stable update, it'll probably make to feisty with a new upstream version, keep the good work!

Changed in gst-plugins-ugly0.10:
importance: Undecided → Low
Changed in gstreamer:
status: Unknown → Unconfirmed
Revision history for this message
Sebastian Dröge (slomo) wrote :

Resetting to confirmed as upstream didn't accept the patch yet.

Changed in gst-plugins-ugly0.10:
status: Fix Committed → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

No need to tag patches there is already an option on the attachment properties to set those

Changed in gstreamer:
status: New → Incomplete
David Futcher (bobbo)
tags: added: patch-forwarded-upstream
removed: patch
Changed in gstreamer:
importance: Unknown → Medium
status: Incomplete → Confirmed
Changed in gstreamer:
status: Confirmed → Incomplete
Changed in gstreamer:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.