changeset 13:4e610984cc3f src

added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
author nicodvb
date Thu, 24 Jul 2008 22:03:06 +0000
parents 056f5573a7dc
children b91b7ea30fd3
files ifo_print.c ifo_print.h nav_print.c
diffstat 3 files changed, 9 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/ifo_print.c	Wed Jul 16 07:46:33 2008 +0000
+++ b/ifo_print.c	Thu Jul 24 22:03:06 2008 +0000
@@ -60,6 +60,10 @@
   printf(" @ %s fps", rate);
 }
 
+void dvdread_print_time(dvd_time_t *dtime) {
+  ifo_print_time(5, dtime);
+}
+
 /* Put this in some other file / package?  It's used in nav_print too.
    Possibly also by the vm / navigator. */
 static void ifo_print_cmd(int row, vm_cmd_t *command) {
@@ -655,7 +659,7 @@
   for(i=0;i<nr;i++) {
     printf("Cell: %3i ", i + 1);
 
-    ifo_print_time(5, &cell_playback[i].playback_time);
+    dvdread_print_time(&cell_playback[i].playback_time);
     printf("\t");
 
     if(cell_playback[i].block_mode || cell_playback[i].block_type) {
@@ -740,7 +744,7 @@
   printf("Number of Cells: %i\n", pgc->nr_of_cells);
   /* Check that time is 0:0:0:0 also if nr_of_programs==0 */
   printf("Playback time: ");
-  ifo_print_time(5, &pgc->playback_time); printf("\n");
+  dvdread_print_time(&pgc->playback_time); printf("\n");
 
   /* If no programs/no time then does this mean anything? */
   printf("Prohibited user operations: ");
--- a/ifo_print.h	Wed Jul 16 07:46:33 2008 +0000
+++ b/ifo_print.h	Thu Jul 24 22:03:06 2008 +0000
@@ -24,6 +24,7 @@
 #include "ifo_types.h"
 
 void ifo_print(dvd_reader_t *dvd, int title);
+void dvdread_print_time(dvd_time_t *dtime);
 
 #endif /* IFO_PRINT_H_INCLUDED */
 
--- a/nav_print.c	Wed Jul 16 07:46:33 2008 +0000
+++ b/nav_print.c	Thu Jul 24 22:03:06 2008 +0000
@@ -32,33 +32,6 @@
 #include "nav_print.h"
 #include "dvdread_internal.h"
 
-static void print_time(dvd_time_t *dtime) {
-  const char *rate;
-  CHECK_VALUE((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa);
-  CHECK_VALUE((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa);
-  CHECK_VALUE((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa);
-  CHECK_VALUE((dtime->frame_u&0xf) < 0xa);
-  
-  printf("%02x:%02x:%02x.%02x", 
-	 dtime->hour,
-	 dtime->minute,
-	 dtime->second,
-	 dtime->frame_u & 0x3f);
-  switch((dtime->frame_u & 0xc0) >> 6) {
-  case 1:
-    rate = "25.00";
-    break;
-  case 3:
-    rate = "29.97";
-    break;
-  default:
-    rate = "(please send a bug report)";
-    break;
-  } 
-  printf(" @ %s fps", rate);
-}
-
-
 static void navPrint_PCI_GI(pci_gi_t *pci_gi) {
   int i;
 
@@ -70,7 +43,7 @@
   printf("vobu_e_ptm    0x%08x\n", pci_gi->vobu_e_ptm);
   printf("vobu_se_e_ptm 0x%08x\n", pci_gi->vobu_se_e_ptm);
   printf("e_eltm        ");
-  print_time(&pci_gi->e_eltm);
+  dvdread_print_time(&pci_gi->e_eltm);
   printf("\n");
   
   printf("vobu_isrc     \"");
@@ -201,7 +174,7 @@
   printf("vobu_vob_idn   0x%04x\n", dsi_gi->vobu_vob_idn);
   printf("vobu_c_idn     0x%02x\n", dsi_gi->vobu_c_idn);
   printf("c_eltm         ");
-  print_time(&dsi_gi->c_eltm);
+  dvdread_print_time(&dsi_gi->c_eltm);
   printf("\n");
 }