rem: switch( iounit->ScaleMode )
add: switch( AHIBase->ahib_ScaleMode )
context: static void UpdateMasterVolume( struct AHIDevUnit *iounit,				struct AHIBase    *AHIBase ){  struct AHIRequest* ioreq1;  struct AHIRequest* ioreq2;  struct Library*    AHIsubBase;  AHIsubBase = ((struct AHIPrivAudioCtrl *) iounit->AudioCtrl)->ahiac_SubLib;  AHIObtainSemaphore(&iounit->Lock);  for(ioreq1 = (struct AHIRequest*) iounit->PlayingList.mlh_Head;      ioreq1->ahir_Std.io_Message.mn_Node.ln_Succ;      ioreq1 = (struct AHIRequest*) ioreq1->ahir_Std.io_Message.mn_Node.ln_Succ)  {    ULONG id     = ioreq1->ahir_Private[1];    int   c      = 0;    LONG  minscale = 0x10000;/*     KPrintF( "Checking id %08lx on request %08lx... ", id, ioreq1 ); */        for(ioreq2 = (struct AHIRequest*) iounit->PlayingList.mlh_Head;	ioreq2->ahir_Std.io_Message.mn_Node.ln_Succ;	ioreq2 = (struct AHIRequest*) ioreq2->ahir_Std.io_Message.mn_Node.ln_Succ)    {      if( ioreq2->ahir_Private[1] == id )      {	++c;	if( GetExtras(ioreq2) && GetExtras(ioreq2)->VolumeScale < minscale )	{	  minscale = GetExtras(ioreq2)->VolumeScale;	}      }    }        if( minscale > 0x10000 / c )    {      minscale = 0x10000 / c;    }    switch( iounit->ScaleMode )    {      case AHI_SCALE_DYNAMIC_SAFE:	if( GetExtras(ioreq1)->VolumeScale > minscale )	{	  GetExtras(ioreq1)->VolumeScale = minscale;	}	break;      case AHI_SCALE_FIXED_SAFE:      case AHI_SCALE_FIXED_0_DB:      case AHI_SCALE_FIXED_3_DB:      case AHI_SCALE_FIXED_6_DB:	GetExtras(ioreq1)->VolumeScale = 0x10000;	break;    }/*     KPrintF( "%ld requests, maxdiv = %ld -> Vol %05lx => %05lx\n", *//* 	     c, maxdiv, ioreq1->ahir_Volume, *//* 	     ioreq1->ahir_Volume / GetExtras(ioreq1)->VolumeDiv ); */  }  // Now update the volume as quickly as possible ...  AHIsub_Disable((struct AHIAudioCtrlDrv *) iounit->AudioCtrl);    for(ioreq1 = (struct AHIRequest*) iounit->PlayingList.mlh_Head;      ioreq1->ahir_Std.io_Message.mn_Node.ln_Succ;      ioreq1 = (struct AHIRequest*) ioreq1->ahir_Std.io_Message.mn_Node.ln_Succ)  {    if( GetExtras(ioreq1)->Channel != NOCHANNEL )    {      AHI_SetVol( GetExtras(ioreq1)->Channel,		  (ULONG) (((long long) ioreq1->ahir_Volume *			    GetExtras(ioreq1)->VolumeScale) >> 16),		  ioreq1->ahir_Position,		  iounit->AudioCtrl,		  AHISF_IMM );    }  }   AHIsub_Enable((struct AHIAudioCtrlDrv *) iounit->AudioCtrl);  // And now the real master volume ...  if( iounit->Unit.unit_OpenCnt == 0 )  {    struct AHIEffMasterVolume vol = {      AHIET_MASTERVOLUME | AHIET_CANCEL,      0x10000    };          AHI_SetEffect( &vol, iounit->AudioCtrl );  }  else  {    struct AHIEffMasterVolume vol = {      AHIET_MASTERVOLUME,      0x10000    };        switch( iounit->ScaleMode )    {      case AHI_SCALE_FIXED_SAFE:	vol.ahiemv_Volume = 0x10000;	break;            case AHI_SCALE_DYNAMIC_SAFE:	vol.ahiemv_Volume = iounit->Channels * 0x10000 / iounit->Unit.unit_OpenCnt;	break;      case AHI_SCALE_FIXED_0_DB:	vol.ahiemv_Volume = iounit->Channels * 0x10000;	break;            case AHI_SCALE_FIXED_3_DB:	vol.ahiemv_Volume = iounit->Channels * 0xB505;	break;	      case AHI_SCALE_FIXED_6_DB:	vol.ahiemv_Volume = iounit->Channels * 0x8000;	break;    }          if( iounit->PseudoStereo )    {      vol.ahiemv_Volume = vol.ahiemv_Volume / 2;    }    AHI_SetEffect( &vol, iounit->AudioCtrl );  }    AHIReleaseSemaphore(&iounit->Lock);}