Cleanups to logging in cdrom_image_backend.c
This commit is contained in:
@@ -170,25 +170,23 @@ cleanup_error:
|
|||||||
static int
|
static int
|
||||||
bin_read(void *priv, uint8_t *buffer, uint64_t seek, size_t count)
|
bin_read(void *priv, uint8_t *buffer, uint64_t seek, size_t count)
|
||||||
{
|
{
|
||||||
track_file_t *tf;
|
track_file_t *tf = NULL;
|
||||||
|
|
||||||
cdrom_image_backend_log("CDROM: binary_read(%08lx, pos=%" PRIu64 " count=%lu)\n",
|
|
||||||
tf->fp, seek, count);
|
|
||||||
|
|
||||||
if ((tf = (track_file_t *) priv)->fp == NULL)
|
if ((tf = (track_file_t *) priv)->fp == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
cdrom_image_backend_log("CDROM: binary_read(%08lx, pos=%" PRIu64 " count=%lu)\n",
|
||||||
|
tf->fp, seek, count);
|
||||||
|
|
||||||
if (fseeko64(tf->fp, seek, SEEK_SET) == -1) {
|
if (fseeko64(tf->fp, seek, SEEK_SET) == -1) {
|
||||||
#ifdef ENABLE_CDROM_IMAGE_BACKEND_LOG
|
|
||||||
cdrom_image_backend_log("CDROM: binary_read failed during seek!\n");
|
cdrom_image_backend_log("CDROM: binary_read failed during seek!\n");
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fread(buffer, count, 1, tf->fp) != 1) {
|
if (fread(buffer, count, 1, tf->fp) != 1) {
|
||||||
#ifdef ENABLE_CDROM_IMAGE_BACKEND_LOG
|
|
||||||
cdrom_image_backend_log("CDROM: binary_read failed during read!\n");
|
cdrom_image_backend_log("CDROM: binary_read failed during read!\n");
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,9 +205,7 @@ bin_read(void *priv, uint8_t *buffer, uint64_t seek, size_t count)
|
|||||||
static uint64_t
|
static uint64_t
|
||||||
bin_get_length(void *priv)
|
bin_get_length(void *priv)
|
||||||
{
|
{
|
||||||
track_file_t *tf;
|
track_file_t *tf = NULL;
|
||||||
|
|
||||||
cdrom_image_backend_log("CDROM: binary_length(%08lx)\n", tf->fp);
|
|
||||||
|
|
||||||
if ((tf = (track_file_t *) priv)->fp == NULL)
|
if ((tf = (track_file_t *) priv)->fp == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1159,10 +1155,9 @@ cdi_load_cue(cd_img_t *cdi, const char *cuefile)
|
|||||||
trk.file = audio_init(filename, &error);
|
trk.file = audio_init(filename, &error);
|
||||||
}
|
}
|
||||||
if (error) {
|
if (error) {
|
||||||
#ifdef ENABLE_CDROM_IMAGE_BACKEND_LOG
|
|
||||||
cdrom_image_backend_log("CUE: cannot open file '%s' in cue sheet!\n",
|
cdrom_image_backend_log("CUE: cannot open file '%s' in cue sheet!\n",
|
||||||
filename);
|
filename);
|
||||||
#endif
|
|
||||||
if (trk.file != NULL) {
|
if (trk.file != NULL) {
|
||||||
trk.file->close(trk.file);
|
trk.file->close(trk.file);
|
||||||
trk.file = NULL;
|
trk.file = NULL;
|
||||||
@@ -1177,9 +1172,8 @@ cdi_load_cue(cd_img_t *cdi, const char *cuefile)
|
|||||||
/* Ignored commands. */
|
/* Ignored commands. */
|
||||||
success = 1;
|
success = 1;
|
||||||
} else {
|
} else {
|
||||||
#ifdef ENABLE_CDROM_IMAGE_BACKEND_LOG
|
|
||||||
cdrom_image_backend_log("CUE: unsupported command '%s' in cue sheet!\n", command);
|
cdrom_image_backend_log("CUE: unsupported command '%s' in cue sheet!\n", command);
|
||||||
#endif
|
|
||||||
success = 0;
|
success = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user