summaryrefslogtreecommitdiffstats
path: root/dvdread/ifo_read.c
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-08-15 11:57:30 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-08-15 11:57:30 +0000
commitd0d245e84c31767cca7584cdbbf7624139d527b4 (patch)
treed825193bcb328883f15e15a46954f376d75595cb /dvdread/ifo_read.c
parent92fe260c85d014d2b387c52bc58351d7f25df16c (diff)
downloadmpv-d0d245e84c31767cca7584cdbbf7624139d527b4.tar.bz2
mpv-d0d245e84c31767cca7584cdbbf7624139d527b4.tar.xz
Sync libdvdread with version 0.9.5 (cosmetic changes).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24070 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'dvdread/ifo_read.c')
-rw-r--r--dvdread/ifo_read.c185
1 files changed, 93 insertions, 92 deletions
diff --git a/dvdread/ifo_read.c b/dvdread/ifo_read.c
index 34ce32f41e..4c6da87667 100644
--- a/dvdread/ifo_read.c
+++ b/dvdread/ifo_read.c
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2000, 2001, 2002, 2003
* Björn Englund <d4bjorn@dtek.chalmers.se>,
@@ -47,19 +48,19 @@
#endif
#ifndef NDEBUG
-#define CHECK_ZERO0(arg) \
- if(arg != 0) { \
+#define CHECK_ZERO0(arg) \
+ if(arg != 0) { \
fprintf(stderr, "*** Zero check failed in %s:%i\n for %s = 0x%x\n", \
- __FILE__, __LINE__, # arg, arg); \
+ __FILE__, __LINE__, # arg, arg); \
}
-#define CHECK_ZERO(arg) \
- if(memcmp(my_friendly_zeros, &arg, sizeof(arg))) { \
- unsigned int i_CZ; \
- fprintf(stderr, "*** Zero check failed in %s:%i\n for %s = 0x", \
- __FILE__, __LINE__, # arg ); \
- for(i_CZ = 0; i_CZ < sizeof(arg); i_CZ++) \
- fprintf(stderr, "%02x", *((uint8_t *)&arg + i_CZ)); \
- fprintf(stderr, "\n"); \
+#define CHECK_ZERO(arg) \
+ if(memcmp(my_friendly_zeros, &arg, sizeof(arg))) { \
+ unsigned int i_CZ; \
+ fprintf(stderr, "*** Zero check failed in %s:%i\n for %s = 0x", \
+ __FILE__, __LINE__, # arg ); \
+ for(i_CZ = 0; i_CZ < sizeof(arg); i_CZ++) \
+ fprintf(stderr, "%02x", *((uint8_t *)&arg + i_CZ)); \
+ fprintf(stderr, "\n"); \
}
static const uint8_t my_friendly_zeros[2048];
#else
@@ -74,7 +75,7 @@ static int ifoRead_VTS(ifo_handle_t *ifofile);
static int ifoRead_PGC(ifo_handle_t *ifofile, pgc_t *pgc, unsigned int offset);
static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
pgc_command_tbl_t *cmd_tbl,
- unsigned int offset);
+ unsigned int offset);
static int ifoRead_PGC_PROGRAM_MAP(ifo_handle_t *ifofile,
pgc_program_map_t *program_map,
unsigned int nr, unsigned int offset);
@@ -91,7 +92,7 @@ static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile, c_adt_t *c_adt,
unsigned int sector);
static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile,
vobu_admap_t *vobu_admap,
- unsigned int sector);
+ unsigned int sector);
static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit,
unsigned int offset);
@@ -140,19 +141,19 @@ ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) {
ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_BACKUP_FILE);
if(!ifoOpen_File(ifofile, title, "BUP")) {
- if(title) {
+ if(title) {
if(dvdread_verbose(dvd) >= 1) {
fprintf(stderr, "libdvdread: Can't open file VTS_%02d_0.%s.\n",
title, "BUP");
}
- } else {
+ } else {
if(dvdread_verbose(dvd) >= 1) {
fprintf(stderr, "libdvdread: Can't open file VIDEO_TS.%s.\n", "BUP");
}
}
return NULL;
}
- }
+ }
return ifofile;
}
@@ -303,7 +304,7 @@ ifo_handle_t *ifoOpenVTSI(dvd_reader_t *dvd, int title) {
if(title <= 0 || title > 99) {
if(dvdread_verbose(dvd) >= 0) {
- fprintf(stderr, "libdvdread: ifoOpenVTSI invalid title (%d).\n", title);
+ fprintf(stderr, "libdvdread: ifoOpenVTSI invalid title (%d).\n", title);
}
free(ifofile);
errno = EINVAL;
@@ -451,12 +452,12 @@ static int ifoRead_VMG(ifo_handle_t *ifofile) {
CHECK_VALUE(vmgi_mat->vmg_nr_of_title_sets != 0);
CHECK_VALUE(vmgi_mat->vmgi_last_byte >= 341);
CHECK_VALUE(vmgi_mat->vmgi_last_byte / DVD_BLOCK_LEN <=
- vmgi_mat->vmgi_last_sector);
+ vmgi_mat->vmgi_last_sector);
/* It seems that first_play_pgc is optional. */
CHECK_VALUE(vmgi_mat->first_play_pgc < vmgi_mat->vmgi_last_byte);
CHECK_VALUE(vmgi_mat->vmgm_vobs == 0 ||
- (vmgi_mat->vmgm_vobs > vmgi_mat->vmgi_last_sector &&
- vmgi_mat->vmgm_vobs < vmgi_mat->vmg_last_sector));
+ (vmgi_mat->vmgm_vobs > vmgi_mat->vmgi_last_sector &&
+ vmgi_mat->vmgm_vobs < vmgi_mat->vmg_last_sector));
CHECK_VALUE(vmgi_mat->tt_srpt <= vmgi_mat->vmgi_last_sector);
CHECK_VALUE(vmgi_mat->vmgm_pgci_ut <= vmgi_mat->vmgi_last_sector);
CHECK_VALUE(vmgi_mat->ptl_mait <= vmgi_mat->vmgi_last_sector);
@@ -546,11 +547,11 @@ static int ifoRead_VTS(ifo_handle_t *ifofile) {
CHECK_VALUE(vtsi_mat->vtsi_last_sector*2 <= vtsi_mat->vts_last_sector);
CHECK_VALUE(vtsi_mat->vtsi_last_byte/DVD_BLOCK_LEN <= vtsi_mat->vtsi_last_sector);
CHECK_VALUE(vtsi_mat->vtsm_vobs == 0 ||
- (vtsi_mat->vtsm_vobs > vtsi_mat->vtsi_last_sector &&
- vtsi_mat->vtsm_vobs < vtsi_mat->vts_last_sector));
+ (vtsi_mat->vtsm_vobs > vtsi_mat->vtsi_last_sector &&
+ vtsi_mat->vtsm_vobs < vtsi_mat->vts_last_sector));
CHECK_VALUE(vtsi_mat->vtstt_vobs == 0 ||
- (vtsi_mat->vtstt_vobs > vtsi_mat->vtsi_last_sector &&
- vtsi_mat->vtstt_vobs < vtsi_mat->vts_last_sector));
+ (vtsi_mat->vtstt_vobs > vtsi_mat->vtsi_last_sector &&
+ vtsi_mat->vtstt_vobs < vtsi_mat->vts_last_sector));
CHECK_VALUE(vtsi_mat->vts_ptt_srpt <= vtsi_mat->vtsi_last_sector);
CHECK_VALUE(vtsi_mat->vts_pgcit <= vtsi_mat->vtsi_last_sector);
CHECK_VALUE(vtsi_mat->vtsm_pgci_ut <= vtsi_mat->vtsi_last_sector);
@@ -586,11 +587,11 @@ static int ifoRead_VTS(ifo_handle_t *ifofile) {
static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
pgc_command_tbl_t *cmd_tbl,
- unsigned int offset) {
+ unsigned int offset) {
unsigned int total;
-
+
memset(cmd_tbl, 0, sizeof(pgc_command_tbl_t));
-
+
if(!DVDFileSeek_(ifofile->file, offset))
return 0;
@@ -601,12 +602,12 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
B2N_16(cmd_tbl->nr_of_post);
B2N_16(cmd_tbl->nr_of_cell);
B2N_16(cmd_tbl->last_byte);
-
+
total = cmd_tbl->nr_of_pre + cmd_tbl->nr_of_post + cmd_tbl->nr_of_cell;
CHECK_VALUE(PGC_COMMAND_TBL_SIZE + total * COMMAND_DATA_SIZE
<= cmd_tbl->last_byte + 1U);
CHECK_VALUE(total <= 255);
-
+
if(cmd_tbl->nr_of_pre != 0) {
unsigned int pre_cmds_size = cmd_tbl->nr_of_pre * COMMAND_DATA_SIZE;
cmd_tbl->pre_cmds = malloc(pre_cmds_size);
@@ -618,18 +619,18 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
return 0;
}
}
-
+
if(cmd_tbl->nr_of_post != 0) {
unsigned int post_cmds_size = cmd_tbl->nr_of_post * COMMAND_DATA_SIZE;
cmd_tbl->post_cmds = malloc(post_cmds_size);
if(!cmd_tbl->post_cmds) {
if(cmd_tbl->pre_cmds)
- free(cmd_tbl->pre_cmds);
+ free(cmd_tbl->pre_cmds);
return 0;
}
if(!(DVDReadBytes(ifofile->file, cmd_tbl->post_cmds, post_cmds_size))) {
if(cmd_tbl->pre_cmds)
- free(cmd_tbl->pre_cmds);
+ free(cmd_tbl->pre_cmds);
free(cmd_tbl->post_cmds);
return 0;
}
@@ -640,16 +641,16 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
cmd_tbl->cell_cmds = malloc(cell_cmds_size);
if(!cmd_tbl->cell_cmds) {
if(cmd_tbl->pre_cmds)
- free(cmd_tbl->pre_cmds);
+ free(cmd_tbl->pre_cmds);
if(cmd_tbl->post_cmds)
- free(cmd_tbl->post_cmds);
+ free(cmd_tbl->post_cmds);
return 0;
}
if(!(DVDReadBytes(ifofile->file, cmd_tbl->cell_cmds, cell_cmds_size))) {
if(cmd_tbl->pre_cmds)
- free(cmd_tbl->pre_cmds);
+ free(cmd_tbl->pre_cmds);
if(cmd_tbl->post_cmds)
- free(cmd_tbl->post_cmds);
+ free(cmd_tbl->post_cmds);
free(cmd_tbl->cell_cmds);
return 0;
}
@@ -676,7 +677,7 @@ static void ifoFree_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl) {
static int ifoRead_PGC_PROGRAM_MAP(ifo_handle_t *ifofile,
pgc_program_map_t *program_map,
- unsigned int nr, unsigned int offset) {
+ unsigned int nr, unsigned int offset) {
unsigned int size = nr * sizeof(pgc_program_map_t);
if(!DVDFileSeek_(ifofile->file, offset))
@@ -708,9 +709,9 @@ static int ifoRead_CELL_PLAYBACK_TBL(ifo_handle_t *ifofile,
/* Changed < to <= because this was false in the movie 'Pi'. */
CHECK_VALUE(cell_playback[i].last_vobu_start_sector <=
- cell_playback[i].last_sector);
+ cell_playback[i].last_sector);
CHECK_VALUE(cell_playback[i].first_sector <=
- cell_playback[i].last_vobu_start_sector);
+ cell_playback[i].last_vobu_start_sector);
}
return 1;
@@ -809,9 +810,9 @@ static int ifoRead_PGC(ifo_handle_t *ifofile, pgc_t *pgc, unsigned int offset) {
free(pgc->program_map);
return 0;
}
- } else {
- pgc->program_map = NULL;
- }
+ } else {
+ pgc->program_map = NULL;
+ }
} else {
pgc->program_map = NULL;
}
@@ -823,21 +824,21 @@ static int ifoRead_PGC(ifo_handle_t *ifofile, pgc_t *pgc, unsigned int offset) {
if(!pgc->cell_playback) {
ifoFree_PGC_COMMAND_TBL(pgc->command_tbl);
if(pgc->program_map)
- free(pgc->program_map);
+ free(pgc->program_map);
return 0;
}
if(!ifoRead_CELL_PLAYBACK_TBL(ifofile, pgc->cell_playback,
- pgc->nr_of_cells,
+ pgc->nr_of_cells,
offset + pgc->cell_playback_offset)) {
ifoFree_PGC_COMMAND_TBL(pgc->command_tbl);
if(pgc->program_map)
- free(pgc->program_map);
+ free(pgc->program_map);
free(pgc->cell_playback);
return 0;
}
- } else {
- pgc->cell_playback = NULL;
- }
+ } else {
+ pgc->cell_playback = NULL;
+ }
} else {
pgc->cell_playback = NULL;
}
@@ -851,14 +852,14 @@ static int ifoRead_PGC(ifo_handle_t *ifofile, pgc_t *pgc, unsigned int offset) {
return 0;
}
if(!ifoRead_CELL_POSITION_TBL(ifofile, pgc->cell_position,
- pgc->nr_of_cells,
+ pgc->nr_of_cells,
offset + pgc->cell_position_offset)) {
ifoFree_PGC(pgc);
return 0;
}
- } else {
- pgc->cell_position = NULL;
- }
+ } else {
+ pgc->cell_position = NULL;
+ }
} else {
pgc->cell_position = NULL;
}
@@ -941,7 +942,7 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofile) {
if(!(DVDReadBytes(ifofile->file, tt_srpt, TT_SRPT_SIZE))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n");
+ fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n");
}
free(tt_srpt);
return 0;
@@ -960,7 +961,7 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofile) {
}
if(!(DVDReadBytes(ifofile->file, tt_srpt->title, info_length))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n");
+ fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n");
}
ifoFree_TT_SRPT(ifofile);
return 0;
@@ -1036,7 +1037,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
return 0;
if(!DVDFileSeek_(ifofile->file,
- ifofile->vtsi_mat->vts_ptt_srpt * DVD_BLOCK_LEN))
+ ifofile->vtsi_mat->vts_ptt_srpt * DVD_BLOCK_LEN))
return 0;
vts_ptt_srpt = malloc(sizeof(vts_ptt_srpt_t));
@@ -1047,7 +1048,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
if(!(DVDReadBytes(ifofile->file, vts_ptt_srpt, VTS_PTT_SRPT_SIZE))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read PTT search table.\n");
+ fprintf(stderr, "libdvdread: Unable to read PTT search table.\n");
}
free(vts_ptt_srpt);
return 0;
@@ -1070,7 +1071,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
}
if(!(DVDReadBytes(ifofile->file, data, info_length))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read PTT search table.\n");
+ fprintf(stderr, "libdvdread: Unable to read PTT search table.\n");
}
free(vts_ptt_srpt);
free(data);
@@ -1203,7 +1204,7 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
CHECK_VALUE(ptl_mait->nr_of_vtss != 0);
CHECK_VALUE(ptl_mait->nr_of_vtss < 100); // ??
CHECK_VALUE(ptl_mait->nr_of_countries * PTL_MAIT_COUNTRY_SIZE
- <= ptl_mait->last_byte + 1 - PTL_MAIT_SIZE);
+ <= ptl_mait->last_byte + 1 - PTL_MAIT_SIZE);
info_length = ptl_mait->nr_of_countries * sizeof(ptl_mait_country_t);
ptl_mait->countries = malloc(info_length);
@@ -1216,7 +1217,7 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
for(i = 0; i < ptl_mait->nr_of_countries; i++) {
if(!(DVDReadBytes(ifofile->file, &ptl_mait->countries[i], PTL_MAIT_COUNTRY_SIZE))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read PTL_MAIT.\n");
+ fprintf(stderr, "libdvdread: Unable to read PTL_MAIT.\n");
}
free(ptl_mait->countries);
free(ptl_mait);
@@ -1241,10 +1242,10 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
uint16_t *pf_temp;
if(!DVDFileSeek_(ifofile->file,
- ifofile->vmgi_mat->ptl_mait * DVD_BLOCK_LEN
+ ifofile->vmgi_mat->ptl_mait * DVD_BLOCK_LEN
+ ptl_mait->countries[i].pf_ptl_mai_start_byte)) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to seak PTL_MAIT table.\n");
+ fprintf(stderr, "libdvdread: Unable to seak PTL_MAIT table.\n");
}
free(ptl_mait->countries);
free(ptl_mait);
@@ -1254,7 +1255,7 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
pf_temp = malloc(info_length);
if(!pf_temp) {
for(j = 0; j < i ; j++) {
- free(ptl_mait->countries[j].pf_ptl_mai);
+ free(ptl_mait->countries[j].pf_ptl_mai);
}
free(ptl_mait->countries);
free(ptl_mait);
@@ -1262,24 +1263,24 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
}
if(!(DVDReadBytes(ifofile->file, pf_temp, info_length))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read PTL_MAIT table.\n");
+ fprintf(stderr, "libdvdread: Unable to read PTL_MAIT table.\n");
}
- free(pf_temp);
- for(j = 0; j < i ; j++) {
- free(ptl_mait->countries[j].pf_ptl_mai);
- }
- free(ptl_mait->countries);
- free(ptl_mait);
- return 0;
+ free(pf_temp);
+ for(j = 0; j < i ; j++) {
+ free(ptl_mait->countries[j].pf_ptl_mai);
+ }
+ free(ptl_mait->countries);
+ free(ptl_mait);
+ return 0;
}
for (j = 0; j < ((ptl_mait->nr_of_vtss + 1) * 8); j++) {
- B2N_16(pf_temp[j]);
+ B2N_16(pf_temp[j]);
}
ptl_mait->countries[i].pf_ptl_mai = malloc(info_length);
if(!ptl_mait->countries[i].pf_ptl_mai) {
free(pf_temp);
for(j = 0; j < i ; j++) {
- free(ptl_mait->countries[j].pf_ptl_mai);
+ free(ptl_mait->countries[j].pf_ptl_mai);
}
free(ptl_mait->countries);
free(ptl_mait);
@@ -1288,10 +1289,10 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
{ /* Transpose the array so we can use C indexing. */
int level, vts;
for(level = 0; level < 8; level++) {
- for(vts = 0; vts <= ptl_mait->nr_of_vtss; vts++) {
- ptl_mait->countries[i].pf_ptl_mai[vts][level] =
- pf_temp[(7-level)*(ptl_mait->nr_of_vtss+1) + vts];
- }
+ for(vts = 0; vts <= ptl_mait->nr_of_vtss; vts++) {
+ ptl_mait->countries[i].pf_ptl_mai[vts][level] =
+ pf_temp[(7-level)*(ptl_mait->nr_of_vtss+1) + vts];
+ }
}
free(pf_temp);
}
@@ -1307,7 +1308,7 @@ void ifoFree_PTL_MAIT(ifo_handle_t *ifofile) {
if(ifofile->ptl_mait) {
for(i = 0; i < ifofile->ptl_mait->nr_of_countries; i++) {
- free(ifofile->ptl_mait->countries[i].pf_ptl_mai);
+ free(ifofile->ptl_mait->countries[i].pf_ptl_mai);
}
free(ifofile->ptl_mait->countries);
free(ifofile->ptl_mait);
@@ -1347,7 +1348,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifofile) {
if(!(DVDReadBytes(ifofile->file, vts_tmapt, VTS_TMAPT_SIZE))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read VTS_TMAPT.\n");
+ fprintf(stderr, "libdvdread: Unable to read VTS_TMAPT.\n");
}
free(vts_tmapt);
ifofile->vts_tmapt = NULL;
@@ -1372,7 +1373,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifofile) {
if(!(DVDReadBytes(ifofile->file, vts_tmap_srp, info_length))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read VTS_TMAPT.\n");
+ fprintf(stderr, "libdvdread: Unable to read VTS_TMAPT.\n");
}
free(vts_tmap_srp);
free(vts_tmapt);
@@ -1381,7 +1382,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifofile) {
}
for (i = 0; i < vts_tmapt->nr_of_tmaps; i++) {
- B2N_32(vts_tmap_srp[i]);
+ B2N_32(vts_tmap_srp[i]);
}
@@ -1405,7 +1406,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifofile) {
if(!(DVDReadBytes(ifofile->file, &vts_tmapt->tmap[i], VTS_TMAP_SIZE))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read VTS_TMAP.\n");
+ fprintf(stderr, "libdvdread: Unable to read VTS_TMAP.\n");
}
ifoFree_VTS_TMAPT(ifofile);
return 0;
@@ -1429,7 +1430,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifofile) {
if(!(DVDReadBytes(ifofile->file, vts_tmapt->tmap[i].map_ent, info_length))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read VTS_TMAP_ENT.\n");
+ fprintf(stderr, "libdvdread: Unable to read VTS_TMAP_ENT.\n");
}
ifoFree_VTS_TMAPT(ifofile);
return 0;
@@ -1451,7 +1452,7 @@ void ifoFree_VTS_TMAPT(ifo_handle_t *ifofile) {
if(ifofile->vts_tmapt) {
for(i = 0; i < ifofile->vts_tmapt->nr_of_tmaps; i++)
if(ifofile->vts_tmapt->tmap[i].map_ent)
- free(ifofile->vts_tmapt->tmap[i].map_ent);
+ free(ifofile->vts_tmapt->tmap[i].map_ent);
free(ifofile->vts_tmapt->tmap);
free(ifofile->vts_tmapt->tmap_offset);
free(ifofile->vts_tmapt);
@@ -1542,7 +1543,7 @@ static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile,
is to high, they high ones are never referenced though. */
if(info_length / sizeof(cell_adr_t) < c_adt->nr_of_vobs) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: *C_ADT nr_of_vobs > avaiable info entries\n");
+ fprintf(stderr, "libdvdread: *C_ADT nr_of_vobs > avaiable info entries\n");
}
c_adt->nr_of_vobs = info_length / sizeof(cell_adr_t);
}
@@ -1567,7 +1568,7 @@ static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile,
CHECK_VALUE(c_adt->cell_adr_table[i].vob_id <= c_adt->nr_of_vobs);
CHECK_VALUE(c_adt->cell_adr_table[i].cell_id > 0);
CHECK_VALUE(c_adt->cell_adr_table[i].start_sector <
- c_adt->cell_adr_table[i].last_sector);
+ c_adt->cell_adr_table[i].last_sector);
}
return 1;
@@ -1654,7 +1655,7 @@ int ifoRead_VOBU_ADMAP(ifo_handle_t *ifofile) {
static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile,
vobu_admap_t *vobu_admap,
- unsigned int sector) {
+ unsigned int sector) {
unsigned int i;
int info_length;
@@ -1678,7 +1679,7 @@ static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile,
}
if(info_length &&
!(DVDReadBytes(ifofile->file,
- vobu_admap->vobu_start_sectors, info_length))) {
+ vobu_admap->vobu_start_sectors, info_length))) {
free(vobu_admap->vobu_start_sectors);
return 0;
}
@@ -1904,7 +1905,7 @@ int ifoRead_PGCI_UT(ifo_handle_t *ifofile) {
free(data);
free(pgci_ut);
ifofile->pgci_ut = 0;
- return 0;
+ return 0;
}
ptr = data;
for(i = 0; i < pgci_ut->nr_of_lus; i++) {
@@ -1918,7 +1919,7 @@ int ifoRead_PGCI_UT(ifo_handle_t *ifofile) {
for(i = 0; i < pgci_ut->nr_of_lus; i++) {
// Maybe this is only defined for v1.1 and later titles?
/* If the bits in 'lu[i].exists' are enumerated abcd efgh then:
- VTS_x_yy.IFO VIDEO_TS.IFO
+ VTS_x_yy.IFO VIDEO_TS.IFO
a == 0x83 "Root" 0x82 "Title"
b == 0x84 "Subpicture"
c == 0x85 "Audio"
@@ -2068,7 +2069,7 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofile) {
CHECK_VALUE(vts_atrt->nr_of_vtss != 0);
CHECK_VALUE(vts_atrt->nr_of_vtss < 100); //??
CHECK_VALUE((uint32_t)vts_atrt->nr_of_vtss * (4 + VTS_ATTRIBUTES_MIN_SIZE) +
- VTS_ATRT_SIZE < vts_atrt->last_byte + 1);
+ VTS_ATRT_SIZE < vts_atrt->last_byte + 1);
info_length = vts_atrt->nr_of_vtss * sizeof(uint32_t);
data = malloc(info_length);
@@ -2146,7 +2147,7 @@ int ifoRead_TXTDT_MGI(ifo_handle_t *ifofile) {
return 1;
if(!DVDFileSeek_(ifofile->file,
- ifofile->vmgi_mat->txtdt_mgi * DVD_BLOCK_LEN))
+ ifofile->vmgi_mat->txtdt_mgi * DVD_BLOCK_LEN))
return 0;
txtdt_mgi = malloc(sizeof(txtdt_mgi_t));
@@ -2157,7 +2158,7 @@ int ifoRead_TXTDT_MGI(ifo_handle_t *ifofile) {
if(!(DVDReadBytes(ifofile->file, txtdt_mgi, TXTDT_MGI_SIZE))) {
if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) {
- fprintf(stderr, "libdvdread: Unable to read TXTDT_MGI.\n");
+ fprintf(stderr, "libdvdread: Unable to read TXTDT_MGI.\n");
}
free(txtdt_mgi);
ifofile->txtdt_mgi = 0;