[BACK]Return to sock.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sndiod

Diff for /src/usr.bin/sndiod/sock.c between version 1.14 and 1.15

version 1.14, 2014/11/21 09:05:38 version 1.15, 2015/02/16 06:35:17
Line 514 
Line 514 
 {  {
         static unsigned char dummy[AMSG_DATAMAX];          static unsigned char dummy[AMSG_DATAMAX];
         unsigned char *data = NULL;          unsigned char *data = NULL;
         struct abuf *buf = NULL;  
         int n, count;          int n, count;
   
 #ifdef DEBUG  #ifdef DEBUG
Line 539 
Line 538 
 #endif  #endif
                 return 1;                  return 1;
         }          }
         if (f->slot)  
                 buf = &f->slot->sub.buf;  
         else  
                 buf = &f->midi->obuf;  
         while (f->wtodo > 0) {          while (f->wtodo > 0) {
                 data = abuf_rgetblk(buf, &count);                  if (f->slot)
                           data = abuf_rgetblk(&f->slot->sub.buf, &count);
                   else if (f->midi)
                           data = abuf_rgetblk(&f->midi->obuf, &count);
                 if (count > f->wtodo)                  if (count > f->wtodo)
                         count = f->wtodo;                          count = f->wtodo;
                 n = sock_fdwrite(f, data, count);                  n = sock_fdwrite(f, data, count);
                 if (n == 0)                  if (n == 0)
                         return 0;                          return 0;
                 f->wtodo -= n;                  f->wtodo -= n;
                 abuf_rdiscard(buf, n);                  if (f->slot)
                           abuf_rdiscard(&f->slot->sub.buf, n);
                   else if (f->midi)
                           abuf_rdiscard(&f->midi->obuf, n);
         }          }
         if (f->slot)          if (f->slot)
                 slot_read(f->slot);                  slot_read(f->slot);
Line 1002 
Line 1003 
                         log_puts(": START message\n");                          log_puts(": START message\n");
                 }                  }
 #endif  #endif
                 if (f->pstate != SOCK_INIT) {                  if (f->pstate != SOCK_INIT || s == NULL) {
 #ifdef DEBUG  #ifdef DEBUG
                         if (log_level >= 1) {                          if (log_level >= 1) {
                                 sock_log(f);                                  sock_log(f);
Line 1103 
Line 1104 
                         log_puts(": SETPAR message\n");                          log_puts(": SETPAR message\n");
                 }                  }
 #endif  #endif
                 if (f->pstate != SOCK_INIT) {                  if (f->pstate != SOCK_INIT || s == NULL) {
 #ifdef DEBUG  #ifdef DEBUG
                         if (log_level >= 1) {                          if (log_level >= 1) {
                                 sock_log(f);                                  sock_log(f);
Line 1127 
Line 1128 
                         log_puts(": GETPAR message\n");                          log_puts(": GETPAR message\n");
                 }                  }
 #endif  #endif
                 if (f->pstate != SOCK_INIT) {                  if (f->pstate != SOCK_INIT || s == NULL) {
 #ifdef DEBUG  #ifdef DEBUG
                         if (log_level >= 1) {                          if (log_level >= 1) {
                                 sock_log(f);                                  sock_log(f);
Line 1168 
Line 1169 
                         log_puts(": SETVOL message\n");                          log_puts(": SETVOL message\n");
                 }                  }
 #endif  #endif
                 if (f->pstate < SOCK_INIT) {                  if (f->pstate < SOCK_INIT || s == NULL) {
 #ifdef DEBUG  #ifdef DEBUG
                         if (log_level >= 1) {                          if (log_level >= 1) {
                                 sock_log(f);                                  sock_log(f);
Line 1192 
Line 1193 
                 f->rtodo = sizeof(struct amsg);                  f->rtodo = sizeof(struct amsg);
                 f->rstate = SOCK_RMSG;                  f->rstate = SOCK_RMSG;
                 f->lastvol = ctl; /* dont trigger feedback message */                  f->lastvol = ctl; /* dont trigger feedback message */
                 dev_midi_vol(s->dev, s);  
                 slot_setvol(s, ctl);                  slot_setvol(s, ctl);
                   dev_midi_vol(s->dev, s);
                 break;                  break;
         case AMSG_AUTH:          case AMSG_AUTH:
 #ifdef DEBUG  #ifdef DEBUG

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15