commit - bee9cc8d6497d0b695087034a5aa2942009e2da7
commit + 795d0831207bf5e71080f7569caf6940cec565ce
blob - 54e4fc551fa5328387a9796fb5c69c6d7fe2e7ee
blob + 558cebc4fdb1a099320e37dba6e4bd5a6e2db944
--- player_mad.c
+++ player_mad.c
#include <mad.h>
#include "amused.h"
+#include "log.h"
struct mad_stream mad_stream;
struct mad_frame mad_frame;
if (buffer->length == 0)
return MAD_FLOW_STOP;
- printf("decode time! start=%p, len=%zu\n", buffer->start, buffer->length);
mad_stream_buffer(stream, buffer->start, buffer->length);
buffer->length = 0;
buffer->sample_rate = 0;
for (i = 0, len = 0; i < nsamples; ++i) {
if (len+4 >= sizeof(buf)) {
sio_write(hdl, buf, len);
- /* fwrite(buf, 1, len, stdout); */
len = 0;
}
}
if (len != 0)
- /* fwrite(buf, 1, len, stdout); */
sio_write(hdl, buf, len);
return MAD_FLOW_CONTINUE;
{
struct buffer *buffer = d;
- warnx("decoding error 0x%04x (%s) at byte offset %zu",
+ /*
+ * most of the decoding errors are actually ID3 tags. Since
+ * they're common, this has a lower priority to avoid spamming
+ * syslog.
+ */
+ log_debug("decoding error 0x%04x (%s) at byte offset %zu",
stream->error, mad_stream_errorstr(stream),
stream->this_frame - (const unsigned char *)buffer->start);