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

Diff for /src/usr.bin/sndiod/dev.c between version 1.80 and 1.81

version 1.80, 2021/01/28 11:06:58 version 1.81, 2021/01/28 11:10:00
Line 2086 
Line 2086 
 void  void
 slot_start(struct slot *s)  slot_start(struct slot *s)
 {  {
           struct dev *d = s->dev;
 #ifdef DEBUG  #ifdef DEBUG
         if (s->pstate != SLOT_INIT) {          if (s->pstate != SLOT_INIT) {
                 slot_log(s);                  slot_log(s);
Line 2098 
Line 2099 
                         log_puts(": playing ");                          log_puts(": playing ");
                         aparams_log(&s->par);                          aparams_log(&s->par);
                         log_puts(" -> ");                          log_puts(" -> ");
                         aparams_log(&s->dev->par);                          aparams_log(&d->par);
                         log_puts("\n");                          log_puts("\n");
                 }                  }
         }          }
Line 2108 
Line 2109 
                         log_puts(": recording ");                          log_puts(": recording ");
                         aparams_log(&s->par);                          aparams_log(&s->par);
                         log_puts(" <- ");                          log_puts(" <- ");
                         aparams_log(&s->dev->par);                          aparams_log(&d->par);
                         log_puts("\n");                          log_puts("\n");
                 }                  }
         }          }
Line 2119 
Line 2120 
                 /*                  /*
                  * N-th recorded block is the N-th played block                   * N-th recorded block is the N-th played block
                  */                   */
                 s->sub.prime = -dev_getpos(s->dev) / s->dev->round;                  s->sub.prime = -dev_getpos(d) / d->round;
         }          }
         s->skip = 0;          s->skip = 0;
   
Line 2127 
Line 2128 
          * get the current position, the origin is when the first sample           * get the current position, the origin is when the first sample
          * played and/or recorded           * played and/or recorded
          */           */
         s->delta = dev_getpos(s->dev) * (int)s->round / (int)s->dev->round;          s->delta = dev_getpos(d) * (int)s->round / (int)d->round;
         s->delta_rem = 0;          s->delta_rem = 0;
   
         if (s->mode & MODE_PLAY) {          if (s->mode & MODE_PLAY) {
Line 2145 
Line 2146 
 slot_detach(struct slot *s)  slot_detach(struct slot *s)
 {  {
         struct slot **ps;          struct slot **ps;
         struct dev *d;          struct dev *d = s->dev;
         long long pos;          long long pos;
   
           for (ps = &d->slot_list; *ps != s; ps = &(*ps)->next) {
 #ifdef DEBUG  #ifdef DEBUG
         if (log_level >= 3) {  
                 slot_log(s);  
                 log_puts(": detaching\n");  
         }  
 #endif  
         for (ps = &s->dev->slot_list; *ps != s; ps = &(*ps)->next) {  
 #ifdef DEBUG  
                 if (*ps == NULL) {                  if (*ps == NULL) {
                         slot_log(s);                          slot_log(s);
                         log_puts(": can't detach, not on list\n");                          log_puts(": can't detach, not on list\n");
Line 2165 
Line 2160 
         }          }
         *ps = s->next;          *ps = s->next;
   
         d = s->dev;  
   
         /*          /*
          * adjust clock, go back d->delta ticks so that slot_attach()           * adjust clock, go back d->delta ticks so that slot_attach()
          * could be called with the resulting state           * could be called with the resulting state
Line 2194 
Line 2187 
         }          }
 #endif  #endif
         if (s->mode & MODE_PLAY)          if (s->mode & MODE_PLAY)
                 dev_mix_adjvol(s->dev);                  dev_mix_adjvol(d);
 }  }
   
 /*  /*

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.81