summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: da3d8ee)
raw | patch | inline | side by side (parent: da3d8ee)
author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | |
Fri, 16 Sep 2011 12:42:53 +0000 (13:42 +0100) | ||
committer | Nikhil Devshatwar <a0132237@ti.com> | |
Fri, 17 May 2013 09:40:39 +0000 (15:10 +0530) |
Some DVD titles are packed in a single set, and we need to use
the correct table to map times to sectors.
https://bugzilla.gnome.org/show_bug.cgi?id=659252
the correct table to map times to sectors.
https://bugzilla.gnome.org/show_bug.cgi?id=659252
ext/dvdread/dvdreadsrc.c | patch | blob | history |
index a46ee4cf6f00973d8886824e76313b28be7f9eb4..a53019f9fd41dcdede6b7e670281c04c88423d94 100644 (file)
--- a/ext/dvdread/dvdreadsrc.c
+++ b/ext/dvdread/dvdreadsrc.c
static gint
gst_dvd_read_src_get_sector_from_time (GstDvdReadSrc * src, GstClockTime ts)
{
- gint sector, i, j;
+ gint sector, j;
- if (src->vts_tmapt == NULL || src->vts_tmapt->nr_of_tmaps == 0)
+ if (src->vts_tmapt == NULL || src->vts_tmapt->nr_of_tmaps < src->ttn)
return -1;
sector = 0;
- for (i = 0; i < src->vts_tmapt->nr_of_tmaps; ++i) {
- for (j = 0; j < src->vts_tmapt->tmap[i].nr_of_entries; ++j) {
- GstClockTime entry_time;
+ for (j = 0; j < src->vts_tmapt->tmap[src->ttn - 1].nr_of_entries; ++j) {
+ GstClockTime entry_time;
- entry_time = src->vts_tmapt->tmap[i].tmu * (j + 1) * GST_SECOND;
- if (entry_time <= ts) {
- sector = src->vts_tmapt->tmap[i].map_ent[j] & 0x7fffffff;
- }
- if (entry_time >= ts) {
- return sector;
- }
+ entry_time = src->vts_tmapt->tmap[src->ttn - 1].tmu * (j + 1) * GST_SECOND;
+ if (entry_time <= ts) {
+ sector = src->vts_tmapt->tmap[src->ttn - 1].map_ent[j] & 0x7fffffff;
+ }
+ if (entry_time >= ts) {
+ return sector;
}
}