changeset 161:81b9602f780c src

report start of PG as well
author mroi
date Sun, 06 Apr 2003 13:05:45 +0000
parents cd96ef8a6204
children 0fd70a257b44
files dvdnav.c dvdnav_events.h
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dvdnav.c	Sun Apr 06 12:47:32 2003 +0000
+++ b/dvdnav.c	Sun Apr 06 13:05:45 2003 +0000
@@ -593,6 +593,7 @@
     cell_event->pgN   = state->pgN;
     cell_event->cell_length =
       dvdnav_convert_time(&state->pgc->cell_playback[state->cellN-1].playback_time);
+
     cell_event->pg_length = 0;
     /* Find start cell of program. */
     first_cell_nr = state->pgc->program_map[state->pgN-1];
@@ -610,7 +611,12 @@
     for (i = 1; i < state->cellN; i++)
       cell_event->cell_start +=
         dvdnav_convert_time(&state->pgc->cell_playback[i - 1].playback_time);
-    
+
+    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);
+
     this->position_current.cell         = this->position_next.cell;
     this->position_current.cell_restart = this->position_next.cell_restart;
     this->position_current.cell_start   = this->position_next.cell_start;
@@ -1084,6 +1090,9 @@
 
 /*
  * $Log$
+ * Revision 1.52  2003/04/06 13:05:45  mroi
+ * report start of PG as well
+ *
  * Revision 1.51  2003/04/04 14:21:32  mroi
  * fill in new timing member in cell_change event
  *
--- a/dvdnav_events.h	Sun Apr 06 12:47:32 2003 +0000
+++ b/dvdnav_events.h	Sun Apr 06 13:05:45 2003 +0000
@@ -151,6 +151,7 @@
   int64_t pg_length;   /* the length of the current program in PTS ticks */
   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 */
 } dvdnav_cell_change_event_t;