Loading vcdlib/fs_bincue.c +50 −32 Original line number Diff line number Diff line Loading @@ -49,8 +49,7 @@ ISO9660 systems, as these were used as references as well. static int init_percd(void); static int percd_done; static file_t bin_cue; static int mounted = 0; static file_t bin_cue = FILEHND_INVALID; static int bincue_sector_size = 2048; void bincue_set_sector_size(int size) Loading @@ -62,9 +61,14 @@ static int bincue_read_sectors(void *buffer, int sector, int cnt) { int i; int _sector; /* sector -= 150; */ /* Maybe a check here would be appropriate to ensure that we /* sector -= 150; */ /* Maybe a check here would be appropriate to ensure that we don't go below zero? */ _sector = sector-150; if (bin_cue == FILEHND_INVALID) return -1; switch (bincue_sector_size) { case 2048: Loading Loading @@ -981,6 +985,20 @@ static vfs_handler_t vh = { iso_ioctl, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* poll */ NULL, /* link */ NULL, /* symlink */ NULL, /* seek64 */ NULL, /* tell64 */ NULL, /* total64 */ NULL, /* readlink */ NULL, NULL }; Loading @@ -988,10 +1006,10 @@ static vfs_handler_t vh = { int fs_bincue_mount(const char *fn) { int i; if (mounted > 0) return -1; mounted ++; if (bin_cue != FILEHND_INVALID) return -1; bin_cue = fs_open(fn, O_RDONLY); if (bin_cue == -1) if (bin_cue == FILEHND_INVALID) return -1; /* Reset fd's */ Loading Loading @@ -1033,6 +1051,7 @@ int fs_bincue_unmount() { vblank_handler_remove(iso_vblank_hnd); fs_close (bin_cue); bin_cue = FILEHND_INVALID; /* Dealloc cache block space */ for(i = 0; i < NUM_CACHE_BLOCKS; i++) { Loading @@ -1043,7 +1062,6 @@ int fs_bincue_unmount() { } read_sectors = cdrom_read_sectors; mounted = 0; /* Free muteces */ mutex_destroy(&cache_mutex); mutex_destroy(&fh_mutex); Loading Loading
vcdlib/fs_bincue.c +50 −32 Original line number Diff line number Diff line Loading @@ -49,8 +49,7 @@ ISO9660 systems, as these were used as references as well. static int init_percd(void); static int percd_done; static file_t bin_cue; static int mounted = 0; static file_t bin_cue = FILEHND_INVALID; static int bincue_sector_size = 2048; void bincue_set_sector_size(int size) Loading @@ -62,9 +61,14 @@ static int bincue_read_sectors(void *buffer, int sector, int cnt) { int i; int _sector; /* sector -= 150; */ /* Maybe a check here would be appropriate to ensure that we /* sector -= 150; */ /* Maybe a check here would be appropriate to ensure that we don't go below zero? */ _sector = sector-150; if (bin_cue == FILEHND_INVALID) return -1; switch (bincue_sector_size) { case 2048: Loading Loading @@ -981,6 +985,20 @@ static vfs_handler_t vh = { iso_ioctl, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* poll */ NULL, /* link */ NULL, /* symlink */ NULL, /* seek64 */ NULL, /* tell64 */ NULL, /* total64 */ NULL, /* readlink */ NULL, NULL }; Loading @@ -988,10 +1006,10 @@ static vfs_handler_t vh = { int fs_bincue_mount(const char *fn) { int i; if (mounted > 0) return -1; mounted ++; if (bin_cue != FILEHND_INVALID) return -1; bin_cue = fs_open(fn, O_RDONLY); if (bin_cue == -1) if (bin_cue == FILEHND_INVALID) return -1; /* Reset fd's */ Loading Loading @@ -1033,6 +1051,7 @@ int fs_bincue_unmount() { vblank_handler_remove(iso_vblank_hnd); fs_close (bin_cue); bin_cue = FILEHND_INVALID; /* Dealloc cache block space */ for(i = 0; i < NUM_CACHE_BLOCKS; i++) { Loading @@ -1043,7 +1062,6 @@ int fs_bincue_unmount() { } read_sectors = cdrom_read_sectors; mounted = 0; /* Free muteces */ mutex_destroy(&cache_mutex); mutex_destroy(&fh_mutex); Loading