Commit eaf2c44e by Luca Barbato Committed by Jean-Baptiste Kempf

events: Clarify which fields are time and which are offsets

cell_length and cell_start are glaringly offsets, pg_length and pg_start seem the same but I'm not sure pgc_length seems rightfully a time. Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent feb09c35
......@@ -688,7 +688,7 @@ dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, uint8_t **buf,
cell_event->cellN = state->cellN;
cell_event->pgN = state->pgN;
cell_event->cell_length =
dvdnav_convert_time(&state->pgc->cell_playback[state->cellN-1].playback_time);
(state->pgc->cell_playback[state->cellN - 1].last_sector + 1);
cell_event->pg_length = 0;
/* Find start cell of program. */
......@@ -700,18 +700,19 @@ dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, uint8_t **buf,
last_cell_nr = state->pgc->nr_of_cells;
for (i = first_cell_nr; i <= last_cell_nr; i++)
cell_event->pg_length +=
dvdnav_convert_time(&state->pgc->cell_playback[i - 1].playback_time);
(state->pgc->cell_playback[i - 1].last_sector + 1);
cell_event->pgc_length = dvdnav_convert_time(&state->pgc->playback_time);
cell_event->cell_start = 0;
for (i = 1; i < state->cellN; i++)
cell_event->cell_start +=
dvdnav_convert_time(&state->pgc->cell_playback[i - 1].playback_time);
(state->pgc->cell_playback[i - 1].last_sector + 1);
cell_event->pg_start = 0;
for (i = 1; i < state->pgc->program_map[state->pgN-1]; i++)
cell_event->pg_start +=
dvdnav_convert_time(&state->pgc->cell_playback[i - 1].playback_time);
(state->pgc->cell_playback[i - 1].last_sector + 1);
this->position_current.cell = this->position_next.cell;
this->position_current.cell_restart = this->position_next.cell_restart;
......
......@@ -139,11 +139,11 @@ typedef struct {
typedef struct {
int cellN; /* the new cell number */
int pgN; /* the current program number */
int64_t cell_length; /* the length of the current cell in PTS ticks */
int64_t pg_length; /* the length of the current program in PTS ticks */
int64_t cell_length; /* the length of the current cell in sectors */
int64_t pg_length; /* the length of the current program in sectors */
int64_t pgc_length; /* the length of the current program chain in PTS ticks */
int64_t cell_start; /* the start time of the current cell relatively to the PGC in PTS ticks */
int64_t pg_start; /* the start time of the current PG relatively to the PGC in PTS ticks */
int64_t cell_start; /* the start offset of the current cell relatively to the PGC in sectors */
int64_t pg_start; /* the start offset of the current PG relatively to the PGC in sectors */
} dvdnav_cell_change_event_t;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment