add SFWrapper error logging
This commit is contained in:
parent
d3af810462
commit
ecbfacef1f
|
@ -91,10 +91,12 @@ SNDFILE* SFWrapper::doOpen(const char* path, int mode, SF_INFO* sfinfo) {
|
||||||
|
|
||||||
f=ps_fopen(path,modeC);
|
f=ps_fopen(path,modeC);
|
||||||
if (f==NULL) {
|
if (f==NULL) {
|
||||||
|
logE("SFWrapper: failed to open (%s)",strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fseek(f,0,SEEK_END)==-1) {
|
if (fseek(f,0,SEEK_END)==-1) {
|
||||||
|
logE("SFWrapper: failed to seek to end (%s)",strerror(errno));
|
||||||
fclose(f);
|
fclose(f);
|
||||||
f=NULL;
|
f=NULL;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -102,6 +104,7 @@ SNDFILE* SFWrapper::doOpen(const char* path, int mode, SF_INFO* sfinfo) {
|
||||||
|
|
||||||
len=ftell(f);
|
len=ftell(f);
|
||||||
if (len==(SIZE_MAX>>1)) {
|
if (len==(SIZE_MAX>>1)) {
|
||||||
|
logE("SFWrapper: failed to tell (%s)",strerror(errno));
|
||||||
len=0;
|
len=0;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
f=NULL;
|
f=NULL;
|
||||||
|
@ -109,6 +112,7 @@ SNDFILE* SFWrapper::doOpen(const char* path, int mode, SF_INFO* sfinfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fseek(f,0,SEEK_SET)==-1) {
|
if (fseek(f,0,SEEK_SET)==-1) {
|
||||||
|
logE("SFWrapper: failed to seek to beginning (%s)",strerror(errno));
|
||||||
len=0;
|
len=0;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
f=NULL;
|
f=NULL;
|
||||||
|
@ -117,5 +121,8 @@ SNDFILE* SFWrapper::doOpen(const char* path, int mode, SF_INFO* sfinfo) {
|
||||||
|
|
||||||
sf=sf_open_virtual(&vio,mode,sfinfo,this);
|
sf=sf_open_virtual(&vio,mode,sfinfo,this);
|
||||||
if (sf!=NULL) fileMode=mode;
|
if (sf!=NULL) fileMode=mode;
|
||||||
|
if (sf==NULL) {
|
||||||
|
logE("SFWrapper: WHY IS IT NULL?!");
|
||||||
|
}
|
||||||
return sf;
|
return sf;
|
||||||
}
|
}
|
Loading…
Reference in a new issue