mirror of https://github.com/ericonr/sndio.git
better debug traces
This commit is contained in:
parent
1ff4add221
commit
b55ceed719
|
@ -351,7 +351,10 @@ midi_out(struct midi *oep, unsigned char *idata, int icount)
|
||||||
{
|
{
|
||||||
unsigned char *odata;
|
unsigned char *odata;
|
||||||
int ocount;
|
int ocount;
|
||||||
|
#ifdef DEBUG
|
||||||
|
int i;
|
||||||
|
#endif
|
||||||
|
|
||||||
while (icount > 0) {
|
while (icount > 0) {
|
||||||
if (oep->obuf.used == oep->obuf.len) {
|
if (oep->obuf.used == oep->obuf.len) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -369,15 +372,18 @@ midi_out(struct midi *oep, unsigned char *idata, int icount)
|
||||||
odata = abuf_wgetblk(&oep->obuf, &ocount);
|
odata = abuf_wgetblk(&oep->obuf, &ocount);
|
||||||
if (ocount > icount)
|
if (ocount > icount)
|
||||||
ocount = icount;
|
ocount = icount;
|
||||||
|
memcpy(odata, idata, ocount);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (log_level >= 4) {
|
if (log_level >= 4) {
|
||||||
midi_log(oep);
|
midi_log(oep);
|
||||||
log_puts(": stored ");
|
log_puts(":");
|
||||||
log_putu(ocount);
|
for (i = 0; i < ocount; i++) {
|
||||||
log_puts(" bytes\n");
|
log_puts(" ");
|
||||||
|
log_putx(odata[i]);
|
||||||
|
}
|
||||||
|
log_puts("\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
memcpy(odata, idata, ocount);
|
|
||||||
abuf_wcommit(&oep->obuf, ocount);
|
abuf_wcommit(&oep->obuf, ocount);
|
||||||
icount -= ocount;
|
icount -= ocount;
|
||||||
idata += ocount;
|
idata += ocount;
|
||||||
|
|
Loading…
Reference in New Issue