Overhaul to console structure, a bit
This commit is contained in:
+12
-12
@@ -139,7 +139,7 @@ static int mp3_startread(snd_stream_t *stream)
|
||||
|
||||
if (p->Stream.error)
|
||||
{
|
||||
Con_Printf("MP3: No valid MP3 frame found\n");
|
||||
console::info("MP3: No valid MP3 frame found\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ static int mp3_startread(snd_stream_t *stream)
|
||||
stream->info.channels = MAD_NCHANNELS(&p->Frame.header);
|
||||
break;
|
||||
default:
|
||||
Con_Printf("MP3: Cannot determine number of channels\n");
|
||||
console::info("MP3: Cannot determine number of channels\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ static int mp3_decode(snd_stream_t *stream, byte *buf, int len)
|
||||
if (mp3_inputdata(stream) == -1)
|
||||
{
|
||||
/* check feof() ?? */
|
||||
Con_DPrintf("mp3 EOF\n");
|
||||
console::debug("mp3 EOF\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,7 @@ static int mp3_decode(snd_stream_t *stream, byte *buf, int len)
|
||||
continue;
|
||||
else
|
||||
{
|
||||
Con_Printf("MP3: unrecoverable frame level error (%s)\n",
|
||||
console::info("MP3: unrecoverable frame level error (%s)\n",
|
||||
mad_stream_errorstr(&p->Stream));
|
||||
break;
|
||||
}
|
||||
@@ -305,7 +305,7 @@ static int mp3_madseek(snd_stream_t *stream, unsigned long offset)
|
||||
MP3_BUFFER_SIZE - leftover, &stream->fh);
|
||||
if (bytes_read <= 0)
|
||||
{
|
||||
Con_DPrintf("seek failure. unexpected EOF (frames=%lu leftover=%lu)\n",
|
||||
console::debug("seek failure. unexpected EOF (frames=%lu leftover=%lu)\n",
|
||||
(unsigned long)p->FrameCount, (unsigned long)leftover);
|
||||
break;
|
||||
}
|
||||
@@ -326,16 +326,16 @@ static int mp3_madseek(snd_stream_t *stream, unsigned long offset)
|
||||
break; /* Normal behaviour; get some more data from the file */
|
||||
if (!MAD_RECOVERABLE(p->Stream.error))
|
||||
{
|
||||
Con_DPrintf("unrecoverable MAD error\n");
|
||||
console::debug("unrecoverable MAD error\n");
|
||||
break;
|
||||
}
|
||||
if (p->Stream.error == MAD_ERROR_LOSTSYNC)
|
||||
{
|
||||
Con_DPrintf("MAD lost sync\n");
|
||||
console::debug("MAD lost sync\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_DPrintf("recoverable MAD error\n");
|
||||
console::debug("recoverable MAD error\n");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -391,24 +391,24 @@ static bool S_MP3_CodecOpenStream (snd_stream_t *stream)
|
||||
|
||||
if (mp3_skiptags(stream) < 0)
|
||||
{
|
||||
Con_Printf("Corrupt mp3 file (bad tags.)\n");
|
||||
console::info("Corrupt mp3 file (bad tags.)\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
stream->priv = calloc(1, sizeof(mp3_priv_t));
|
||||
if (!stream->priv)
|
||||
{
|
||||
Con_Printf("Insufficient memory for MP3 audio\n");
|
||||
console::info("Insufficient memory for MP3 audio\n");
|
||||
return false;
|
||||
}
|
||||
err = mp3_startread(stream);
|
||||
if (err != 0)
|
||||
{
|
||||
Con_Printf("%s is not a valid mp3 file\n", stream->name);
|
||||
console::info("%s is not a valid mp3 file\n", stream->name);
|
||||
}
|
||||
else if (stream->info.channels != 1 && stream->info.channels != 2)
|
||||
{
|
||||
Con_Printf("Unsupported number of channels %d in %s\n",
|
||||
console::info("Unsupported number of channels %d in %s\n",
|
||||
stream->info.channels, stream->name);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user