Changeset 6ba6c14fd5e810734e4170bbb95b1a731525212c
- Timestamp:
- 20/12/04 05:52:29 (4 years ago)
- git-parent:
- Files:
-
- modules/access/vcdx/access.c (modified) (9 diffs)
- modules/access/vcdx/info.c (modified) (2 diffs)
- modules/access/vcdx/info.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/access/vcdx/access.c
rcf38ae4 r6ba6c14 35 35 36 36 #include "vcd.h" 37 #include " vcdplayer.h"37 #include "info.h" 38 38 #include "intf.h" 39 #include "info.h"40 39 #include "vlc_keys.h" 41 40 … … 224 223 if ( VCDReadSector( VLC_OBJECT(p_access), p_vcd->vcd, 225 224 p_vcd->i_lsn, 226 (byte_t *) p_block->p_buffer + (i_index*M2F2_SECTOR_SIZE) ) < 0 ) 227 { 225 (byte_t *) p_block->p_buffer 226 + (i_index*M2F2_SECTOR_SIZE) ) < 0 ) 227 { 228 228 LOG_ERR ("could not read sector %lu", 229 229 (long unsigned int) p_vcd->i_lsn ); 230 /* Try to skip one sector (in case of bad sectors) */ 231 p_vcd->i_lsn ++; 232 p_access->info.i_pos += M2F2_SECTOR_SIZE; 230 233 return NULL; 234 } 235 236 p_vcd->i_lsn ++; 237 p_access->info.i_pos += M2F2_SECTOR_SIZE; 238 239 /* Update seekpoint */ 240 if ( VCDINFO_ITEM_TYPE_ENTRY == p_vcd->play_item.type ) 241 { 242 const input_title_t *t = p_vcd->p_title[p_access->info.i_title]; 243 244 if( t->i_seekpoint > 0 && 245 p_access->info.i_seekpoint + 1 < t->i_seekpoint && 246 p_access->info.i_pos + i_read * M2F2_SECTOR_SIZE >= 247 t->seekpoint[p_access->info.i_seekpoint+1]->i_byte_offset ) 248 { 249 const track_t i_track = p_vcd->i_track; 250 const unsigned int i_entry = ++p_vcd->play_item.num; 251 msg_Dbg( p_access, "seekpoint change" ); 252 VCDSetOrigin( p_access, 253 vcdinfo_get_track_lsn(p_vcd->vcd, i_track), 254 vcdinfo_get_entry_lsn(p_vcd->vcd, i_entry), 255 vcdinfo_get_track_lsn(p_vcd->vcd, i_track+1), 256 i_track, &(p_vcd->play_item) ); 231 257 } 232 233 p_vcd->i_lsn ++; 234 258 } 235 259 } 236 260 … … 244 268 } 245 269 270 p_vcd->i_lsn ++; 246 271 return NULL; 247 272 } 248 249 /* Update seekpoints */250 for( i_read = 0; i_read < i_blocks; i_read++ )251 {252 input_title_t *t = p_vcd->p_title[p_access->info.i_title];253 254 if( t->i_seekpoint > 0 &&255 p_access->info.i_seekpoint + 1 < t->i_seekpoint &&256 p_access->info.i_pos + i_read * M2F2_SECTOR_SIZE >=257 t->seekpoint[p_access->info.i_seekpoint+1]->i_byte_offset )258 {259 msg_Dbg( p_access, "seekpoint change" );260 p_access->info.i_update |= INPUT_UPDATE_SEEKPOINT;261 p_access->info.i_seekpoint++;262 }263 }264 265 /* Update a few values */266 p_vcd->i_lsn += i_blocks;267 p_access->info.i_pos += p_block->i_buffer;268 273 269 274 return p_block; … … 845 850 p_access->info.i_size = p_vcd->p_title[i_title]->i_size; 846 851 p_access->info.i_pos = ( i_lsn - origin_lsn ) * M2F2_SECTOR_SIZE; 847 p_access->info.i_update |= INPUT_UPDATE_TITLE|INPUT_UPDATE_SIZE; 852 p_access->info.i_update |= INPUT_UPDATE_TITLE|INPUT_UPDATE_SIZE 853 | INPUT_UPDATE_SEEKPOINT; 848 854 849 855 dbg_print( (INPUT_DBG_CALL|INPUT_DBG_LSN), … … 853 859 (long unsigned int) end_lsn, i_track ); 854 860 855 VCDUpdateVar( p_access, p_itemid->num, VLC_VAR_SETVALUE, 856 "chapter", 857 p_itemid->type == VCDINFO_ITEM_TYPE_ENTRY ? 858 _("Entry") : _("Segment"), 859 "Setting entry/segment"); 861 if (p_itemid->type == VCDINFO_ITEM_TYPE_ENTRY) { 862 VCDUpdateVar( p_access, p_itemid->num, VLC_VAR_SETVALUE, 863 "chapter", _("Entry"), "Setting entry/segment"); 864 p_access->info.i_seekpoint = p_itemid->num; 865 } else { 866 VCDUpdateVar( p_access, p_itemid->num, VLC_VAR_SETVALUE, 867 "chapter", _("Segment"), "Setting entry/segment"); 868 /* seekpoint is what? ??? */ 869 } 870 871 { 872 unsigned int psz_mrl_max = strlen(VCD_MRL_PREFIX) 873 + strlen(p_vcd->psz_source) + sizeof("@E999")+3; 874 char *psz_mrl = malloc( psz_mrl_max ); 875 876 if( psz_mrl ) 877 { 878 char *psz_name; 879 snprintf(psz_mrl, psz_mrl_max, "%s%s", 880 VCD_MRL_PREFIX, p_vcd->psz_source); 881 psz_name = VCDFormatStr( p_access, p_vcd, 882 config_GetPsz( p_access, MODULE_STRING 883 "-title-format" ), 884 psz_mrl, &(p_vcd->play_item) ); 885 input_Control( p_vcd->p_input, INPUT_SET_NAME, psz_name ); 886 free(psz_mrl); 887 } 888 } 889 860 890 } 861 891 … … 1061 1091 } 1062 1092 1063 #if 11064 1093 b_play_ok = (VLC_SUCCESS == VCDPlay( p_access, itemid )); 1065 1094 … … 1068 1097 goto err_exit; 1069 1098 } 1070 #else1071 /* We assume playing CD track 2 (1st MPEG data) for now */1072 1073 p_vcd->origin_lsn = p_vcd->i_lsn = p_vcd->p_sectors[1];1074 p_access->info.i_title = 0;1075 p_access->info.i_seekpoint = 0;1076 p_access->info.i_size = p_vcd->p_title[0]->i_size;1077 p_access->info.i_pos = 0;1078 1079 #endif1080 1099 1081 1100 p_access->psz_demux = strdup( "ps" ); … … 1280 1299 input_title_t *t = p_vcd->p_title[p_access->info.i_title]; 1281 1300 i = (int)va_arg( args, int ); 1301 1302 dbg_print( INPUT_DBG_EVENT, "set seekpoint" ); 1282 1303 if( t->i_seekpoint > 0 ) 1283 1304 { … … 1301 1322 1302 1323 case ACCESS_SET_PRIVATE_ID_STATE: 1303 dbg_print( INPUT_DBG_EVENT, "set seekpoint/setprivate id" );1324 dbg_print( INPUT_DBG_EVENT, "set private id" ); 1304 1325 return VLC_EGENERIC; 1305 1326 modules/access/vcdx/info.c
rcf38ae4 r6ba6c14 27 27 #include "vcd.h" 28 28 #include <vlc_playlist.h> 29 #include "vcdplayer.h"30 29 #include "vlc_keys.h" 30 #include "info.h" 31 31 32 32 #include <cdio/cdio.h> … … 36 36 #include <libvcd/info.h> 37 37 #include <libvcd/logging.h> 38 39 static char *VCDFormatStr(const access_t *p_access, access_vcd_data_t *p_vcd,40 const char format_str[], const char *mrl,41 const vcdinfo_itemid_t *itemid);42 38 43 39 static inline void modules/access/vcdx/info.h
rcf38ae4 r6ba6c14 22 22 *****************************************************************************/ 23 23 24 #ifndef VCD_INFO_H 25 #define VCD_INFO_H 26 27 #include "vcdplayer.h" 28 24 29 /* 25 30 Fills out playlist information. … … 38 43 const char format_str[], const char *mrl, 39 44 const vcdinfo_itemid_t *itemid); 45 46 #endif /* VCD_INFO_H */
