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

Diff for /src/usr.bin/sndiod/opt.c between version 1.7 and 1.8

version 1.7, 2021/03/03 10:13:06 version 1.8, 2021/03/03 10:19:06
Line 89 
Line 89 
                 case SYSEX_MMC_STOP:                  case SYSEX_MMC_STOP:
                         if (len != SYSEX_SIZE(stop))                          if (len != SYSEX_SIZE(stop))
                                 return;                                  return;
                         if (!o->mmc)                          if (o->mtc == NULL)
                                 return;                                  return;
                         if (log_level >= 2) {                          if (log_level >= 2) {
                                 log_puts(o->name);                                  log_puts(o->name);
                                 log_puts(": mmc stop\n");                                  log_puts(": mmc stop\n");
                         }                          }
                         dev_mmcstop(o->dev);                          mtc_stop(o->mtc);
                         break;                          break;
                 case SYSEX_MMC_START:                  case SYSEX_MMC_START:
                         if (len != SYSEX_SIZE(start))                          if (len != SYSEX_SIZE(start))
                                 return;                                  return;
                         if (!o->mmc)                          if (o->mtc == NULL)
                                 return;                                  return;
                         if (log_level >= 2) {                          if (log_level >= 2) {
                                 log_puts(o->name);                                  log_puts(o->name);
                                 log_puts(": mmc start\n");                                  log_puts(": mmc start\n");
                         }                          }
                         dev_mmcstart(o->dev);                          mtc_start(o->mtc);
                         break;                          break;
                 case SYSEX_MMC_LOC:                  case SYSEX_MMC_LOC:
                         if (len != SYSEX_SIZE(loc) ||                          if (len != SYSEX_SIZE(loc) ||
                             x->u.loc.len != SYSEX_MMC_LOC_LEN ||                              x->u.loc.len != SYSEX_MMC_LOC_LEN ||
                             x->u.loc.cmd != SYSEX_MMC_LOC_CMD)                              x->u.loc.cmd != SYSEX_MMC_LOC_CMD)
                                 return;                                  return;
                         if (!o->mmc)                          if (o->mtc == NULL)
                                 return;                                  return;
                         switch (x->u.loc.hr >> 5) {                          switch (x->u.loc.hr >> 5) {
                         case MTC_FPS_24:                          case MTC_FPS_24:
Line 126 
Line 126 
                                 fps = 30;                                  fps = 30;
                                 break;                                  break;
                         default:                          default:
                                 dev_mmcstop(o->dev);                                  mtc_stop(o->mtc);
                                 return;                                  return;
                         }                          }
                         dev_mmcloc(o->dev,                          mtc_loc(o->mtc,
                             (x->u.loc.hr & 0x1f) * 3600 * MTC_SEC +                              (x->u.loc.hr & 0x1f) * 3600 * MTC_SEC +
                              x->u.loc.min * 60 * MTC_SEC +                               x->u.loc.min * 60 * MTC_SEC +
                              x->u.loc.sec * MTC_SEC +                               x->u.loc.sec * MTC_SEC +
Line 206 
Line 206 
                 log_puts(": already defined\n");                  log_puts(": already defined\n");
                 return NULL;                  return NULL;
         }          }
   
           if (mmc) {
                   if (mtc_array[0].dev != NULL && mtc_array[0].dev != d) {
                           log_puts(name);
                           log_puts(": MTC already setup for another device\n");
                           return NULL;
                   }
                   mtc_array[0].dev = d;
                   if (log_level >= 2) {
                           dev_log(d);
                           log_puts(": initial MTC source, controlled by MMC\n");
                   }
           }
   
         o = xmalloc(sizeof(struct opt));          o = xmalloc(sizeof(struct opt));
         o->num = num;          o->num = num;
         o->dev = d;          o->dev = d;
Line 229 
Line 243 
                 o->rmax = rmax;                  o->rmax = rmax;
         }          }
         o->maxweight = maxweight;          o->maxweight = maxweight;
         o->mmc = mmc;          o->mtc = mmc ? &mtc_array[0] : NULL;
         o->dup = dup;          o->dup = dup;
         o->mode = mode;          o->mode = mode;
         memcpy(o->name, name, len + 1);          memcpy(o->name, name, len + 1);
Line 261 
Line 275 
                         log_putu(o->rmax);                          log_putu(o->rmax);
                 }                  }
                 if (o->mode & (MODE_RECMASK | MODE_PLAY)) {                  if (o->mode & (MODE_RECMASK | MODE_PLAY)) {
                         if (o->mmc)                          if (o->mtc)
                                 log_puts(" mmc");                                  log_puts(" mtc");
                         if (o->dup)                          if (o->dup)
                                 log_puts(" dup");                                  log_puts(" dup");
                 }                  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8