Fix error returns.
This commit is contained in:
@@ -186,8 +186,7 @@ int RageSoundReader_WAV::seek_sample_fmt_normal( Uint32 ms )
|
|||||||
const int pos = (int) (this->fmt.data_starting_offset + offset);
|
const int pos = (int) (this->fmt.data_starting_offset + offset);
|
||||||
|
|
||||||
int rc = fseek( this->rw, pos, SEEK_SET );
|
int rc = fseek( this->rw, pos, SEEK_SET );
|
||||||
if( rc != pos )
|
BAIL_IF_MACRO(rc == -1, strerror(errno), -1);
|
||||||
return -1;
|
|
||||||
|
|
||||||
return ms;
|
return ms;
|
||||||
}
|
}
|
||||||
@@ -374,8 +373,7 @@ int RageSoundReader_WAV::seek_sample_fmt_adpcm( Uint32 ms )
|
|||||||
|
|
||||||
const int pos = skipsize + this->fmt.data_starting_offset;
|
const int pos = skipsize + this->fmt.data_starting_offset;
|
||||||
int rc = fseek(this->rw, pos, SEEK_SET);
|
int rc = fseek(this->rw, pos, SEEK_SET);
|
||||||
BAIL_IF_MACRO(rc == -1, strerror(errno), 0);
|
BAIL_IF_MACRO(rc == -1, strerror(errno), -1);
|
||||||
BAIL_IF_MACRO(rc != pos, "end of file", 0);
|
|
||||||
|
|
||||||
/* The offset we need is in this block, so we need to decode to there. */
|
/* The offset we need is in this block, so we need to decode to there. */
|
||||||
skipsize += (offset % bpb);
|
skipsize += (offset % bpb);
|
||||||
|
|||||||
Reference in New Issue
Block a user