diff options
author | gpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-09-22 08:46:05 +0000 |
---|---|---|
committer | gpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-09-22 08:46:05 +0000 |
commit | 3b01938238d84315d03b1369043e6330db9292fa (patch) | |
tree | 47903f9aad7e514e9da36968e855ecdcba6009a6 /libmpdemux/vcd_read_nbsd.h | |
parent | ddf74b2732f43a902bba835f57236a5fc2bb8141 (diff) | |
download | mpv-3b01938238d84315d03b1369043e6330db9292fa.tar.bz2 mpv-3b01938238d84315d03b1369043e6330db9292fa.tar.xz |
Prints the numbers of start and end tracks and MSF length for each
track of a VCD when -identify is given.
Patch by kiriuja < mplayer TIREH patches AH en TIREH directo POIS net >
Original Thread:
Date: Sep 11, 2005 3:30 AM
Subject: [MPlayer-dev-eng] [PATCH] -identify VCD tracks
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16548 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/vcd_read_nbsd.h')
-rw-r--r-- | libmpdemux/vcd_read_nbsd.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/libmpdemux/vcd_read_nbsd.h b/libmpdemux/vcd_read_nbsd.h index f50d7954d5..055b2d93a0 100644 --- a/libmpdemux/vcd_read_nbsd.h +++ b/libmpdemux/vcd_read_nbsd.h @@ -84,16 +84,21 @@ vcd_read_toc(int fd) { struct ioc_toc_header tochdr; mp_vcd_priv_t* vcd; - int i; + int i, min = 0, sec = 0, frame = 0; if (ioctl(fd, CDIOREADTOCHEADER, &tochdr) == -1) { mp_msg(MSGT_OPEN,MSGL_ERR,"read CDROM toc header: %s\n",strerror(errno)); return; } - for (i = tochdr.starting_track; i <= tochdr.ending_track; i++) { + if (identify) + { + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VCD_START_TRACK=%d\n", tochdr.starting_track); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VCD_END_TRACK=%d\n", tochdr.ending_track); + } + for (i = tochdr.starting_track; i <= tochdr.ending_track + 1; i++) { struct ioc_read_toc_entry tocentry; struct cd_toc_entry tocentry_data; - tocentry.starting_track = i; + tocentry.starting_track = i<=tochdr.ending_track ? i : CDROM_LEADOUT; tocentry.address_format = CD_MSF_FORMAT; tocentry.data_len = sizeof(struct cd_toc_entry); tocentry.data = &tocentry_data; @@ -102,6 +107,7 @@ vcd_read_toc(int fd) mp_msg(MSGT_OPEN,MSGL_ERR,"read CDROM toc entry: %s\n",strerror(errno)); return NULL; } + if (i <= tochdr.ending_track) mp_msg(MSGT_OPEN,MSGL_INFO,"track %02d: adr=%d ctrl=%d format=%d %02d:%02d:%02d\n", (int) tocentry.starting_track, (int) tocentry.data->addr_type, @@ -111,6 +117,30 @@ vcd_read_toc(int fd) (int) tocentry.data->addr.msf.second, (int) tocentry.data->addr.msf.frame ); + + if (identify) + { + if (i > tochdr.starting_track) + { + min = tocentry.data->addr.msf.minute - min; + sec = tocentry.data->addr.msf.second - sec; + frame = tocentry.data->addr.msf.frame - frame; + if ( frame < 0 ) + { + frame += 75; + sec --; + } + if ( sec < 0 ) + { + sec += 60; + min --; + } + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VCD_TRACK_%d_MSF=%02d:%02d:%02d\n", i - 1, min, sec, frame); + } + min = tocentry.data->addr.msf.minute; + sec = tocentry.data->addr.msf.second; + frame = tocentry.data->addr.msf.frame; + } } vcd = malloc(sizeof(mp_vcd_priv_t)); vcd->fd = fd; |