diff options
author | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-11-10 00:36:39 +0000 |
---|---|---|
committer | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-11-10 00:36:39 +0000 |
commit | f544f53cebc286bcae49193bbd7839f9e15ce136 (patch) | |
tree | f0e762e89fb5842c410d9a68fdcf69f7a037d0b7 | |
parent | 866ba3f296d465949544c2d2a5740bc56b7992cf (diff) |
idenfify now shows the timings of chapters of the chosen pgc
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20828 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | stream/stream_dvd.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 4608dfcac0..e6ead589ef 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -517,6 +517,31 @@ static int seek_to_chapter(stream_t *stream, ifo_handle_t *vts_file, tt_srpt_t * return chapter; } +static void list_chapters(pgc_t *pgc) +{ + unsigned int i, cell; + unsigned int t=0, t2=0; + + if(pgc->nr_of_programs < 2) + return; + + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "CHAPTERS: "); + for(i=0; i<pgc->nr_of_programs-1; i++) + { + cell = pgc->program_map[i]; //here the cell is 1-based + t2 = t/1000; + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "%02d:%02d:%02d,", t2/3600, (t2/60)%60, t2%60); + while(cell < pgc->program_map[i+1]) { + if(!(pgc->cell_playback[cell-1].block_type == BLOCK_TYPE_ANGLE_BLOCK && + pgc->cell_playback[cell-1].block_mode != BLOCK_MODE_FIRST_CELL) + ) + t += dvdtimetomsec(&pgc->cell_playback[cell-1].playback_time); + cell++; + } + } + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "\n"); +} + static double dvd_get_current_time(stream_t *stream, int cell) { int i, tm; @@ -982,6 +1007,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { return STREAM_UNSUPORTED; for(k=0; k<d->cur_pgc->nr_of_cells; k++) d->cell_times_table[k] = dvdtimetomsec(&d->cur_pgc->cell_playback[k].playback_time); + list_chapters(d->cur_pgc); // ... (unimplemented) // return NULL; |