# HG changeset patch # User nicodvb # Date 1216936986 0 # Node ID 4e610984cc3fa4f61766be11190b97afbd2f6955 # Parent 056f5573a7dc738f938af81d86e9d0cfc9593ccf added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org diff -r 056f5573a7dc -r 4e610984cc3f ifo_print.c --- 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;inr_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: "); diff -r 056f5573a7dc -r 4e610984cc3f ifo_print.h --- 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 */ diff -r 056f5573a7dc -r 4e610984cc3f nav_print.c --- 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"); }