From: Rocky B. <ro...@us...> - 2002-12-30 15:48:30
|
Update of /cvsroot/xine/xine-vcdnav/vcdimager-0.7.12-rocky/libvcd In directory sc8-pr-cvs1:/tmp/cvs-serv22166 Modified Files: vcd_image_bincue.c Log Message: Probably better at faking tracks information on files. Slightly better error message on no "bin/cue" write. Remove a debug message and fix a bug in not noting sucessful cue read in. Index: vcd_image_bincue.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/vcdimager-0.7.12-rocky/libvcd/vcd_image_bincue.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- vcd_image_bincue.c 30 Dec 2002 06:11:24 -0000 1.5 +++ vcd_image_bincue.c 30 Dec 2002 15:48:27 -0000 1.6 @@ -90,12 +90,16 @@ } if (!_obj->have_cue ) { - /* Make one big track, track 0 and 1 are the same. */ + /* Time to fake things... + Make one big track, track 0 and 1 are the same. + We are guessing stuff atarts a msf 00:04:00 - 2 for the 150 + sector pregap and 2 for the cue information. + */ int blocksize = _obj->sector_2336_flag ? M2RAW_SECTOR_SIZE : CDDA_SECTOR_SIZE; _obj->total_tracks = 2; _obj->tocent[0].start_msf.m = to_bcd8(0); - _obj->tocent[0].start_msf.s = to_bcd8(0); + _obj->tocent[0].start_msf.s = to_bcd8(4); _obj->tocent[0].start_msf.f = to_bcd8(0); _obj->tocent[0].blocksize = blocksize; @@ -182,7 +186,7 @@ free(_obj->bin_file); _obj->bin_file = s; */ - printf("Found file name %s\n", s); + /* printf("Found file name %s\n", s); */ } else if (2==sscanf(p, "TRACK %d MODE2/%d", &track_num, &blocksize)) { _obj->tocent[_obj->total_tracks].blocksize = blocksize; _obj->tocent[_obj->total_tracks].track_num = track_num; @@ -192,10 +196,14 @@ /*printf("Added track %d with blocksize %d\n", track_num, blocksize);*/ } else if (4==sscanf(p, "INDEX %d %d:%d:%d", &start_index, &min, &sec, &frame)) { - if (!seen_first_index_for_track) { + /* FIXME! all of this is a big hack. + If start_index == 0, then this is the "last_cue" information. + The +2 below seconds is to adjust for the 150 pregap. + */ + if (!seen_first_index_for_track && start_index != 0) { _obj->tocent[_obj->total_tracks-1].start_index = start_index; _obj->tocent[_obj->total_tracks-1].start_msf.m = to_bcd8 (min); - _obj->tocent[_obj->total_tracks-1].start_msf.s = to_bcd8 (sec); + _obj->tocent[_obj->total_tracks-1].start_msf.s = to_bcd8 (sec)+2; _obj->tocent[_obj->total_tracks-1].start_msf.f = to_bcd8 (frame); seen_first_index_for_track=true; } @@ -205,6 +213,8 @@ if (line) free(line); + _obj->have_cue = _obj->total_tracks != 0; + fclose (fp); return true; } @@ -356,8 +366,6 @@ /*! Return the size in bytes of the track that starts at "track". The first track is 1. - - FIXME: This should get moved to vcdinfo... */ static uint32_t _vcd_get_track_size (void *user_data, unsigned int track) @@ -452,10 +460,10 @@ return; if (!(_obj->bin_snk = vcd_data_sink_new_stdio (_obj->bin_fname))) - vcd_error ("init failed"); + vcd_error ("init of .bin failed"); if (!(_obj->cue_snk = vcd_data_sink_new_stdio (_obj->cue_fname))) - vcd_error ("init failed"); + vcd_error ("init of .cue failed"); _obj->init = true; } |