Changeset 4577:e9b3b3b521dd in roaraudio
- Timestamp:
- 11/02/10 21:31:36 (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r4576 r4577 1 1 v. 0.4beta2 - ? 2 2 * Announce standards via OpenSLP (Closes: #5) 3 3 4 4 v. 0.4beta1 - Mon Nov 01 2010 16:14 CET -
roard/caps.c
r4510 r4577 55 55 }; 56 56 57 char * stds_string (void) { 58 size_t len = g_caps_stds.stds_len * 14; 59 char * ret = roar_mm_malloc(len); 60 size_t off = 0; 61 size_t i; 62 int snpret; 63 uint32_t cap; 64 int version; 65 66 if ( ret == NULL ) 67 return NULL; 68 69 for (i = 0; i < g_caps_stds.stds_len; i++) { 70 cap = g_caps_stds.stds[i]; 71 version = ROAR_STD_VERSION(cap); 72 if ( version == 0 ) { 73 snpret = snprintf(ret+off, len-off, "%i-%i,", ROAR_STD_VENDOR(cap), ROAR_STD_STD(cap)); 74 } else { 75 snpret = snprintf(ret+off, len-off, "%i-%i-%i,", ROAR_STD_VENDOR(cap), ROAR_STD_STD(cap), version); 76 } 77 if ( snpret > 0 ) { 78 off += snpret; 79 } else { 80 roar_mm_free(ret); 81 return NULL; 82 } 83 } 84 85 ret[off-1] = 0; 86 87 return ret; 88 } 89 57 90 //ll -
roard/include/caps.h
r4505 r4577 31 31 struct roar_stds g_caps_stds; 32 32 33 char * stds_string (void); 34 33 35 #endif 34 36 -
roard/roard.c
r4482 r4577 1325 1325 char * location; 1326 1326 char * description; 1327 char * standards; 1327 1328 1328 1329 if ( sockname != NULL ) … … 1352 1353 } 1353 1354 1355 standards = stds_string(); 1356 1357 if ( standards == NULL ) { 1358 if ( (standards = roar_mm_malloc(1)) == NULL ) { 1359 SLPClose(hslp); 1360 return -1; 1361 } 1362 standards[0] = 0; 1363 } 1364 1354 1365 snprintf(attr, sizeof(attr), "(wave-rate=%i),(wave-channels=%i),(wave-bits=%i)," 1355 1366 #ifndef ROAR_WITHOUT_DCOMP_LIGHT 1356 1367 "(light-channels=%i)," 1357 1368 #endif 1369 "(standards=%s)," 1358 1370 "(location=%s),(description=%s)", 1359 1371 g_sa->rate, g_sa->channels, g_sa->bits, … … 1361 1373 g_light_state.channels, 1362 1374 #endif 1375 standards, 1363 1376 location, description 1364 1377 ); 1378 1379 roar_mm_free(standards); 1365 1380 1366 1381 /* Register a service with SLP */
Note: See TracChangeset
for help on using the changeset viewer.