diff options
author | 2010-01-03 18:34:13 +0100 | |
---|---|---|
committer | 2010-01-03 18:34:13 +0100 | |
commit | fa519319f3c31f7ca63740c953c35dd4dc9e4b4a (patch) | |
tree | 6ef9ed18d2db6c3a989d81f65f84c999c4b5e602 /plugins/flac/flac.c | |
parent | de5bcbefc5817688baa32f85d7940ea8f41ba6e8 (diff) |
compiler warning cleanup
Diffstat (limited to 'plugins/flac/flac.c')
-rw-r--r-- | plugins/flac/flac.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c index 75a8faf9..d3424831 100644 --- a/plugins/flac/flac.c +++ b/plugins/flac/flac.c @@ -69,6 +69,9 @@ FLAC__StreamDecoderReadStatus flac_read_cb (const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderSeekStatus flac_seek_cb (const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) { cue_cb_data_t *cb = (cue_cb_data_t *)client_data; int r = deadbeef->fseek (cb->file, absolute_byte_offset, SEEK_SET); + if (r) { + return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; + } return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } @@ -100,7 +103,7 @@ cflac_write_callback (const FLAC__StreamDecoder *decoder, const FLAC__Frame *fra } int bitrate = -1; float sec = ((float)frame->header.blocksize / frame->header.sample_rate); - if (cb->bytesread != 0 && sec != 0) { + if (cb->bytesread != 0 && sec > 0) { bitrate = cb->bytesread / sec * 8; } cb->bytesread = 0; @@ -293,7 +296,6 @@ cflac_read_int16 (char *bytes, int size) { } } int initsize = size; - int nbytes_in = 0; do { if (remaining) { int s = size * 2; |