index a63fa3509213b15ed446ec6929e10c937480d3bf..a53019f9fd41dcdede6b7e670281c04c88423d94 100644 (file)
--- a/ext/dvdread/dvdreadsrc.c
+++ b/ext/dvdread/dvdreadsrc.c
while (pgc->cell_playback[cell].block_mode != BLOCK_MODE_LAST_CELL)
++cell;
- return cell + 1; /* really +1? (tpm) */
+ return cell + 1;
}
/* Returns true if the pack is a NAV pack */
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;
}
}
GstSegment *seg;
guint8 oneblock[DVD_VIDEO_LB_LEN];
dsi_t dsi_pack;
- guint next_vobu, next_ilvu_start, cur_output_size;
+ guint next_vobu, cur_output_size;
gint len;
gint retries;
gint64 next_time;
/* determine where we go next. These values are the ones we
* mostly care about */
- next_ilvu_start = src->cur_pack + dsi_pack.sml_agli.data[angle].address;
cur_output_size = dsi_pack.dsi_gi.vobu_ea + 1;
/* If we're not at the end of this cell, we can determine the next