Use ERROR only once for our ogg vorbis errors, so we don't get a timestamp mid line

git-svn-id: https://svn.musicpd.org/mpd/trunk@4402 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
J. Alexander Treuman 2006-07-19 15:58:11 +00:00
parent 9f6364af45
commit 649a037e8d

View File

@ -240,6 +240,7 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
long test; long test;
ReplayGainInfo * replayGainInfo = NULL; ReplayGainInfo * replayGainInfo = NULL;
char ** comments; char ** comments;
char * errorStr;
data.inStream = inStream; data.inStream = inStream;
data.dc = dc; data.dc = dc;
@ -252,27 +253,28 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
if((ret = ov_open_callbacks(&data, &vf, NULL, 0, callbacks)) < 0) { if((ret = ov_open_callbacks(&data, &vf, NULL, 0, callbacks)) < 0) {
closeInputStream(inStream); closeInputStream(inStream);
if(!dc->stop) { if(!dc->stop) {
ERROR("Error decoding Ogg Vorbis stream: ");
switch(ret) { switch(ret) {
case OV_EREAD: case OV_EREAD:
ERROR("read error\n"); errorStr = "read error";
break; break;
case OV_ENOTVORBIS: case OV_ENOTVORBIS:
ERROR("not vorbis stream\n"); errorStr = "not vorbis stream";
break; break;
case OV_EVERSION: case OV_EVERSION:
ERROR("vorbis version mismatch\n"); errorStr = "vorbis version mismatch";
break; break;
case OV_EBADHEADER: case OV_EBADHEADER:
ERROR("invalid vorbis header\n"); errorStr = "invalid vorbis header";
break; break;
case OV_EFAULT: case OV_EFAULT:
ERROR("internal logic error\n"); errorStr = "internal logic error";
break; break;
default: default:
ERROR("unknown error\n"); errorStr = "unknown error";
break; break;
} }
ERROR("Error decoding Ogg Vorbis stream: %s\n",
errorStr);
return -1; return -1;
} }
else { else {