Changeset 4503:86f76891c2ab in roaraudio


Ignore:
Timestamp:
10/13/10 03:12:27 (8 years ago)
Author:
phi
Branch:
default
Message:

support names an version zero

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarctl.c

    r4501 r4503  
    251251 size_t i; 
    252252 int vendor, standard, version; 
     253 char numbuf[2][8]; 
     254 const char * vendor_name; 
    253255 
    254256 if ( roar_caps_stds(con, &stds, NULL, -1) == -1 ) { 
     
    261263  standard = ROAR_STD_STD(stds->stds[i]); 
    262264  version  = ROAR_STD_VERSION(stds->stds[i]); 
    263   printf("Server standard       : %i-%i-%i\n", vendor, standard, version); 
     265 
     266  if ( (vendor_name = roar_stds_vendor2str(vendor)) == NULL ) { 
     267   snprintf(numbuf[0], sizeof(numbuf[0]), "%i", vendor); 
     268   numbuf[0][sizeof(numbuf[0])-1] = 0; 
     269   vendor_name = numbuf[0]; 
     270  } 
     271 
     272  if ( version == 0 ) { 
     273   numbuf[1][0] = 0; 
     274  } else { 
     275   snprintf(numbuf[1], sizeof(numbuf[1]), "-%i", version); 
     276   numbuf[1][sizeof(numbuf[1])-1] = 0; 
     277  } 
     278 
     279  printf("Server standard       : %s-%i%s\n", vendor_name, standard, numbuf[1]); 
    264280 } 
    265281} 
Note: See TracChangeset for help on using the changeset viewer.