From: Rocky B. <ro...@us...> - 2003-07-22 01:15:49
|
Update of /cvsroot/xine/xine-vcdnav/input In directory sc8-pr-cvs1:/tmp/cvs-serv12718/input Modified Files: vcdio.c vcdplayer.c vcdplayer.h xineplug_inp_vcd.c Log Message: MRL format changed to conform more to a vlc-compatible format. (Don't worry, vlc's MRL format's been changed too.) Thus the second : is now @ and we go back to an older format where we used vcdx:// rather than vcdx:/. For example xine vcdx:///dev/cdrom@E4 rather than xine vcdx://dev/cdrom:E4. We internally use LSN's rather than LBA's. It cleans up the code a little bit. Index: vcdio.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/input/vcdio.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- vcdio.c 13 Jun 2003 23:38:52 -0000 1.36 +++ vcdio.c 22 Jul 2003 00:50:20 -0000 1.37 @@ -124,7 +124,7 @@ for (i=0; i<this->num_tracks; i++) { unsigned int track_num=i+1; this->track[i].size = vcdinfo_get_track_sect_count(obj, track_num); - this->track[i].start_LBA = vcdinfo_get_track_lba(obj, track_num); + this->track[i].start_LSN = vcdinfo_get_track_lsn(obj, track_num); } } else this->track = NULL; @@ -135,7 +135,7 @@ for (i=0; i<this->num_entries; i++) { this->entry[i].size = vcdinfo_get_entry_sect_count(obj, i); - this->entry[i].start_LBA = vcdinfo_get_entry_lba(obj, i); + this->entry[i].start_LSN = vcdinfo_get_entry_lsn(obj, i); } } else this->entry = NULL; @@ -150,7 +150,7 @@ descriptions of those for why. */ this->segment[i].size = vcdinfo_get_seg_sector_count(obj, i); - this->segment[i].start_LBA = vcdinfo_get_seg_lba(obj, i); + this->segment[i].start_LSN = vcdinfo_get_seg_lsn(obj, i); } } else this->segment = NULL; @@ -170,18 +170,18 @@ switch (origin) { case SEEK_SET: { - lba_t old_lba = this->cur_lba; - this->cur_lba = this->origin_lba + (offset / M2F2_SECTOR_SIZE); + lsn_t old_lsn = this->cur_lsn; + this->cur_lsn = this->origin_lsn + (offset / M2F2_SECTOR_SIZE); dbg_print(INPUT_DBG_SEEK_SET, "seek_set to %ld => %u (start is %u)\n", - (long int) offset, this->cur_lba, this->origin_lba); + (long int) offset, this->cur_lsn, this->origin_lsn); /* Seek was successful. Invalidate entry location by setting entry number back to 1. Over time it will adjust upward to the correct value. */ if ( !vcdplayer_pbc_is_on(this) && this->play_item.type != VCDINFO_ITEM_TYPE_TRACK - && this->cur_lba < old_lba) { + && this->cur_lsn < old_lsn) { dbg_print(INPUT_DBG_SEEK_SET, "seek_set entry backwards\n"); this->next_entry = 1; } @@ -199,15 +199,15 @@ } if (this->slider_length == VCDPLAYER_SLIDER_LENGTH_TRACK) { - diff = this->cur_lba - this->track_lba; + diff = this->cur_lsn - this->track_lsn; dbg_print(INPUT_DBG_SEEK_CUR, "current pos: %u, track diff %ld\n", - this->cur_lba, (long int) diff); + this->cur_lsn, (long int) diff); } else { - diff = this->cur_lba - this->origin_lba; + diff = this->cur_lsn - this->origin_lsn; dbg_print(INPUT_DBG_SEEK_CUR, "current pos: %u, entry diff %ld\n", - this->cur_lba, (long int) diff); + this->cur_lsn, (long int) diff); } if (diff < 0) { Index: vcdplayer.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/input/vcdplayer.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- vcdplayer.c 18 May 2003 05:37:12 -0000 1.71 +++ vcdplayer.c 22 Jul 2003 00:50:20 -0000 1.72 @@ -332,7 +332,7 @@ this->default_entry = VCDINFO_INVALID_ENTRY; break; case PSD_TYPE_END_LIST: - this->origin_lba = this->cur_lba = this->end_lba = VCDINFO_NULL_LBA; + this->origin_lsn = this->cur_lsn = this->end_lsn = VCDINFO_NULL_LSN; /* Fall through */ case PSD_TYPE_COMMAND_LIST: this->next_entry = this->prev_entry = this->return_entry = @@ -356,7 +356,7 @@ max_entry = this->num_entries; min_entry = 0; /* Can remove when Entries start at 1. */ this->cur_track = vcdinfo_get_track(obj, play_item); - this->track_lba = vcdinfo_get_track_lba(obj, this->cur_track); + this->track_lsn = vcdinfo_get_track_lsn(obj, this->cur_track); break; case VCDINFO_ITEM_TYPE_SEGMENT: max_entry = this->num_segments; @@ -366,7 +366,7 @@ case VCDINFO_ITEM_TYPE_TRACK: max_entry = this->num_tracks; this->cur_track = this->play_item.num; - this->track_lba = vcdinfo_get_track_lba(obj, this->cur_track); + this->track_lsn = vcdinfo_get_track_lsn(obj, this->cur_track); break; default: ; /* Handle exceptional cases below */ } @@ -414,14 +414,14 @@ itemid.num = track_num; itemid.type = VCDINFO_ITEM_TYPE_TRACK; this->in_still = 0; - this->cur_lba = vcdinfo_get_track_lba(obj, track_num); + this->cur_lsn = vcdinfo_get_track_lsn(obj, track_num); this->play_item = itemid; this->cur_track = track_num; - this->track_lba = this->cur_lba; + this->track_lsn = this->cur_lsn; _vcdplayer_set_origin(this); - dbg_print(INPUT_DBG_LBA, "LBA: %u\n", this->cur_lba); + dbg_print(INPUT_DBG_LSN, "LSN: %u\n", this->cur_lsn); } } @@ -443,17 +443,17 @@ itemid.num = num; itemid.type = VCDINFO_ITEM_TYPE_ENTRY; this->in_still = 0; - this->cur_lba = vcdinfo_get_entry_lba(obj, num); + this->cur_lsn = vcdinfo_get_entry_lsn(obj, num); this->play_item = itemid; this->cur_track = vcdinfo_get_track(obj, num); - this->track_lba = vcdinfo_get_track_lba(obj, this->cur_track); - this->track_end_lba = this->track_lba + + this->track_lsn = vcdinfo_get_track_lsn(obj, this->cur_track); + this->track_end_lsn = this->track_lsn + this->track[this->cur_track-1].size; _vcdplayer_set_origin(this); - dbg_print(INPUT_DBG_LBA, "LBA: %u, track_end LBA: %u\n", - this->cur_lba, this->track_end_lba); + dbg_print(INPUT_DBG_LSN, "LSN: %u, track_end LSN: %u\n", + this->cur_lsn, this->track_end_lsn); } } @@ -472,10 +472,10 @@ } else { vcdinfo_itemid_t itemid; - this->cur_lba = vcdinfo_get_seg_lba(obj, num-1); + this->cur_lsn = vcdinfo_get_seg_lsn(obj, num-1); this->cur_track = 0; - if (VCDINFO_NULL_LBA==this->cur_lba) { + if (VCDINFO_NULL_LSN==this->cur_lsn) { LOG_ERR(this, "%s %d\n", _("Error in getting current segment number"), num); return; @@ -487,7 +487,7 @@ _vcdplayer_set_origin(this); - dbg_print(INPUT_DBG_LBA, "LBA: %u\n", this->cur_lba); + dbg_print(INPUT_DBG_LSN, "LSN: %u\n", this->cur_lsn); } } @@ -557,7 +557,7 @@ case VCDINFO_ITEM_TYPE_NOTFOUND: dbg_print(INPUT_DBG_PBC, "play nothing\n"); - this->cur_lba = this->end_lba; + this->cur_lsn = this->end_lsn; return; default: @@ -664,18 +664,18 @@ /* Set's start origin and size for subsequent seeks. - input: this->cur_lba, this->play_item - changed: this->origin_lba, this->end_lba + input: this->cur_lsn, this->play_item + changed: this->origin_lsn, this->end_lsn */ static void _vcdplayer_set_origin(vcdplayer_input_t *this) { size_t size = _vcdplayer_get_item_size(this, this->play_item); - this->end_lba = this->cur_lba + size; - this->origin_lba = this->cur_lba; + this->end_lsn = this->cur_lsn + size; + this->origin_lsn = this->cur_lsn; - dbg_print((INPUT_DBG_CALL|INPUT_DBG_LBA), "end LBA: %u\n", this->end_lba); + dbg_print((INPUT_DBG_CALL|INPUT_DBG_LSN), "end LSN: %u\n", this->end_lsn); } #define RETURN_NULL_BLOCK \ @@ -717,10 +717,10 @@ sequence (or track). */ if ( (VCDINFO_ITEM_TYPE_ENTRY == this->play_item.type) && - (this->cur_lba < this->track_end_lba) ) { + (this->cur_lsn < this->track_end_lsn) ) { /* Set up to just continue to the next entry */ this->play_item.num++; - dbg_print( (INPUT_DBG_LBA|INPUT_DBG_PBC), + dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC), "continuing into next entry: %u\n", this->play_item.num); vcdplayer_play_single_item(this, this->play_item); this->update_title(); @@ -854,7 +854,7 @@ RETURN_NULL_STILL ; /* Hack: Just go back and do still again */ /*this->force_redisplay(); - this->cur_lba = this->origin_lba;*/ + this->cur_lsn = this->origin_lsn;*/ } else return READ_END; break; @@ -864,7 +864,7 @@ RETURN_NULL_STILL ; /* Hack: Just go back and do still again */ /*this->force_redisplay(); - this->cur_lba = this->origin_lba;*/ + this->cur_lsn = this->origin_lsn;*/ } else return READ_END; break; @@ -874,7 +874,7 @@ RETURN_NULL_STILL ; /* Hack: Just go back and do still again */ /* this->force_redisplay(); - this->cur_lba = this->origin_lba; */ + this->cur_lsn = this->origin_lsn; */ } else return READ_END; break; @@ -882,7 +882,7 @@ if (this->in_still) { /* Hack: Just go back and do still again */ this->force_redisplay(); - this->cur_lba = this->origin_lba; + this->cur_lsn = this->origin_lsn; } else return READ_END; } @@ -903,12 +903,12 @@ this->handle_events (); - if ( this->cur_lba >= this->end_lba ) { + if ( this->cur_lsn >= this->end_lsn ) { vcdplayer_read_status_t read_status; /* We've run off of the end of this entry. Do we continue or stop? */ - dbg_print( (INPUT_DBG_LBA|INPUT_DBG_PBC), - "end reached, cur: %u, end: %u\n", this->cur_lba, this->end_lba); + dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC), + "end reached, cur: %u, end: %u\n", this->cur_lsn, this->end_lsn); handle_item_continuation: read_status = vcdplayer_pbc_is_on(this) @@ -936,20 +936,18 @@ vcdsector_t vcd_sector; do { - lsn_t lsn = cdio_lba_to_lsn (this->cur_lba) ; - - dbg_print(INPUT_DBG_LBA, "LBA: %u\n", this->cur_lba); - if (cdio_read_mode2_sector(img, &vcd_sector, lsn, true)!=0) { - dbg_print(INPUT_DBG_LBA, "read error\n"); + dbg_print(INPUT_DBG_LSN, "LSN: %u\n", this->cur_lsn); + if (cdio_read_mode2_sector(img, &vcd_sector, this->cur_lsn, true)!=0) { + dbg_print(INPUT_DBG_LSN, "read error\n"); return READ_ERROR; } - this->cur_lba++; + this->cur_lsn++; - if ( this->cur_lba >= this->end_lba ) { + if ( this->cur_lsn >= this->end_lsn ) { /* We've run off of the end of this entry. Do we continue or stop? */ - dbg_print( (INPUT_DBG_LBA|INPUT_DBG_PBC), + dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC), "end reached in reading, cur: %u, end: %u\n", - this->cur_lba, this->end_lba); + this->cur_lsn, this->end_lsn); break; } @@ -959,7 +957,7 @@ */ } while((vcd_sector.subheader[2]&~0x01)==0x60); - if ( this->cur_lba >= this->end_lba ) + if ( this->cur_lsn >= this->end_lsn ) /* We've run off of the end of this entry. Do we continue or stop? */ goto handle_item_continuation; Index: vcdplayer.h =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/input/vcdplayer.h,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- vcdplayer.h 17 May 2003 11:17:46 -0000 1.53 +++ vcdplayer.h 22 Jul 2003 00:50:20 -0000 1.54 @@ -48,7 +48,7 @@ #define INPUT_DBG_MRL 4 #define INPUT_DBG_XINECALL 8 /* just xine calls to plugin */ #define INPUT_DBG_CALL 16 /* routine calls */ -#define INPUT_DBG_LBA 32 /* LBA changes */ +#define INPUT_DBG_LSN 32 /* LSN changes */ #define INPUT_DBG_PBC 64 /* Playback control */ #define INPUT_DBG_CDIO 128 /* Debugging from CDIO */ #define INPUT_DBG_SEEK_SET 256 /* Seeks to set location */ @@ -88,7 +88,7 @@ } vcdplayer_autoplay_t; typedef struct { - lba_t start_LBA; /* LBA where play item starts */ + lsn_t start_LSN; /* LSN where play item starts */ size_t size; /* size in sector units of play item. */ } vcdplayer_play_item_info; @@ -155,11 +155,11 @@ uint16_t return_entry; /* Entry index to use if return is pressed */ uint16_t default_entry; /* Default selection entry. */ - lba_t cur_lba; /* LBA of where we are right now */ - lba_t end_lba; /* LBA of end of current entry/segment/track. */ - lba_t origin_lba; /* LBA of start of slider position. */ - lba_t track_lba; /* LBA of start track origin of track we are in. */ - lba_t track_end_lba; /* LBA of end of current track (if entry). */ + lsn_t cur_lsn; /* LSN of where we are right now */ + lsn_t end_lsn; /* LSN of end of current entry/segment/track. */ + lsn_t origin_lsn; /* LSN of start of slider position. */ + lsn_t track_lsn; /* LSN of start track origin of track we are in. */ + lsn_t track_end_lsn; /* LSN of end of current track (if entry). */ /*-------------------------------------------------------------- Medium information @@ -169,10 +169,10 @@ char *default_vcd_device; /* Use this if none given in mrl */ bool opened; /* true if initialized */ - int num_tracks; /* Number of tracks in medium */ - int num_segments; /* Number of segments in medium */ - int num_entries; /* Number of entries in medium */ - int num_LIDs; /* Number of LIDs in medium */ + unsigned int num_tracks; /* Number of tracks in medium */ + unsigned int num_segments; /* Number of segments in medium */ + unsigned int num_entries; /* Number of entries in medium */ + unsigned int num_LIDs; /* Number of LIDs in medium */ /* Tracks, segment, and entry information. The number of entries for each is given by the corresponding num_* field above. */ Index: xineplug_inp_vcd.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/input/xineplug_inp_vcd.c,v retrieving revision 1.87 retrieving revision 1.88 diff -u -r1.87 -r1.88 --- xineplug_inp_vcd.c 4 Jun 2003 11:56:30 -0000 1.87 +++ xineplug_inp_vcd.c 22 Jul 2003 00:50:20 -0000 1.88 @@ -46,7 +46,7 @@ #include <ctype.h> #define SHORT_PLUGIN_NAME "VCDX" -#define MRL_PREFIX "vcdx:/" +#define MRL_PREFIX "vcdx://" #define MRL_PREFIX_LEN strlen(MRL_PREFIX) /* Xine includes */ @@ -374,23 +374,23 @@ vcdx:/[vcd_path][:[EPTS]?number]\*? Examples - vcdx:/ - Play (navigate) default device: /dev/cdrom - vcdx:/: - same as above - vcdx://dev/cdrom - probably same as above - vcdx://dev/cdrom2 - Play (navigate) /dev/cdrom2 - vcdx://dev/cdrom2: - same as above - vcdx://dev/cdrom2:T1 - Play Track 1 from /dev/cdrom2 - vcdx://dev/cdrom:S1 - Play selection id 1 from /dev/cdrom - vcdx://dev/cdrom:E0 - Play Entry id 0 from default device - vcdx:/:P1 - probably same as above. + vcdx:// - Play (navigate) default device: /dev/cdrom + vcdx://@ - same as above + vcdx:///dev/cdrom - probably same as above + vcdx:///dev/cdrom2 - Play (navigate) /dev/cdrom2 + vcdx:///dev/cdrom2: - same as above + vcdx:///dev/cdrom2@T1 - Play Track 1 from /dev/cdrom2 + vcdx:///dev/cdrom@S1 - Play selection id 1 from /dev/cdrom + vcdx://dev/cdrom@E0 - Play Entry id 0 from default device + vcdx://@P1 - probably same as above. If there is no playback control, MRL will get converted into vcdx:/:E0 - vcdx:/:P1* - probably same as above. - vcdx:/:S1 - Play segment 1 from default device - vcdx:/:3 - Play track 3 from default device - vcdx://dev/cdrom2:1 - Play track 1 from /dev/cdrom2 - vcdx://tmp/ntsc.bin: - Play default item from /tmp/ntsc.bin - vcdx://tmp/ntsc.bin/:E0 - Play entry 0 of /tmp/ntsc.bin + vcdx://@P1* - probably same as above. + vcdx://@S1 - Play segment 1 from default device + vcdx://@3 - Play track 3 from default device + vcdx:///dev/cdrom2@1 - Play track 1 from /dev/cdrom2 + vcdx:///tmp/ntsc.bin@ - Play default item from /tmp/ntsc.bin + vcdx:///tmp/ntsc.bin/@E0 - Play entry 0 of /tmp/ntsc.bin parameters: mrl : mrl to parse @@ -420,7 +420,7 @@ return false; } - count = sscanf (p, "%[^:]:%1[EePpSsTt]%u", + count = sscanf (p, "%[^@]@%1[EePpSsTt]%u", device_str, type_str, &num); itemid->num = num; @@ -446,7 +446,7 @@ /* No device/file given, so use the default device and try again. */ strncpy(device_str, default_vcd_device, default_vcd_device_len+1); - if (p[0] == ':') p++; + if (p[0] == '@') p++; count = sscanf (p, "%1[EePpSsTt]%u", type_str, &num); type_str[0] = toupper(type_str[0]); itemid->num = num; @@ -711,7 +711,7 @@ /* This is the only situation where the size of the current play item is not static. It depends what the current play-item is. */ - old_get_length = (this->end_lba - this->origin_lba) * + old_get_length = (this->end_lsn - this->origin_lsn) * M2F2_SECTOR_SIZE; return old_get_length; break; @@ -1584,7 +1584,7 @@ --------------------------------------------------------------*/ my_vcd.player.cur_lid = VCDINFO_INVALID_ENTRY; - my_vcd.player.end_lba = VCDINFO_NULL_LBA; + my_vcd.player.end_lsn = VCDINFO_NULL_LSN; my_vcd.player.pdi = -1; my_vcd.player.pxd.psd = NULL; @@ -1633,7 +1633,7 @@ (char **) autoplay_modes, _("default type to use on VCD autoplay"), _("What play unit to use when none is specified in an MRL, e.g. " - "vcdx:/ or vcdx://dev/dvd:"), + "vcdx:// or vcdx:///dev/dvd:"), 0, vcd_default_autoplay_cb, class); |