Commit cb1503fb authored by Nico Sabbi's avatar Nico Sabbi
Browse files

added dvdread_print_time() and removed the file-static print_time() in nav_print.c

parent faa1b2a4
......@@ -60,6 +60,10 @@ static void ifo_print_time(int level, dvd_time_t *dtime) {
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 @@ static void ifo_print_CELL_PLAYBACK(cell_playback_t *cell_playback, int nr) {
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 @@ void ifo_print_PGC(pgc_t *pgc) {
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: ");
......
......@@ -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 */
......
......@@ -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 @@ static void navPrint_PCI_GI(pci_gi_t *pci_gi) {
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 @@ static void navPrint_DSI_GI(dsi_gi_t *dsi_gi) {
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");
}
......
Supports Markdown
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