4 title_t(zmpeg3_t *zsrc, char *fpath)
6 fs = new fs_t(zsrc, fpath);
11 title_t(zmpeg3_t *zsrc)
13 fs = new fs_t(*zsrc->fs);
21 if( cell_table_allocation )
26 title_t(ztitle_t &title)
29 fs = new fs_t(*title.fs);
30 total_bytes = title.total_bytes;
31 start_byte = title.start_byte;
32 end_byte = title.end_byte;
34 if( title.cell_table_size && title.cell_table ) {
35 cell_table_allocation = title.cell_table_allocation;
36 cell_table = new cell_t[cell_table_allocation];
37 cell_table_size = title.cell_table_size;
38 for( int i=0; i<cell_table_size; ++i ) {
39 cell_table[i] = title.cell_table[i];
47 printf("path %s 0x%jx-0x%jx cell_table_size %d\n",
48 fs->path, start_byte, end_byte, cell_table_size);
49 for( int i=0; i<cell_table_size; ++i ) {
50 printf("0x%jx-0x%jx 0x%jx-0x%jx\n",
51 cell_table[i].title_start, cell_table[i].title_end,
52 cell_table[i].program_start, cell_table[i].program_end);
60 if( !cell_table || cell_table_allocation <= cell_table_size ) {
61 long new_allocation = cell_table_allocation ?
62 2*cell_table_size : 64;
63 cell_t *new_table = new cell_t[new_allocation];
64 for( int i=0; i<cell_table_size; ++i )
65 new_table[i] = cell_table[i];
67 cell_table = new_table;
68 cell_table_allocation = new_allocation;
73 new_cell(int cell_no, int64_t title_start, int64_t title_end,
74 int64_t program_start, int64_t program_end, int discontinuity)
77 cell_t *cell = &cell_table[cell_table_size];
78 cell->cell_no = cell_no;
79 cell->title_start = title_start;
80 cell->title_end = title_end;
81 cell->program_start = program_start;
82 cell->program_end = program_end;
83 cell->cell_time = -1.;
84 cell->discontinuity = discontinuity;
89 print_cells(FILE *output)
92 for( int i=0; i<cell_table_size; ++i ) {
93 cell_t *cell = &cell_table[i];
94 fprintf(output, "REGION: 0x%jx-0x%jx 0x%jx-0x%jx\n",
95 cell->program_start, cell->program_end,
96 cell->title_start, cell->title_end);