Changeset 5149:b7345c9daac1 in roaraudio for libroar
- Timestamp:
- 10/15/11 15:24:11 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/caps.c
r4944 r5149 36 36 #include "libroar.h" 37 37 38 const struct roar_stds * libroar_libstds(void) { 39 static const uint32_t std[] = { 40 ROAR_STD_MAKE(ROAR_STDV_ROARAUDIO, 0, 0) // ra-msg-v0 41 }; 42 static const struct roar_stds stds = {.stds_len = sizeof(std)/sizeof(*std), .stds = (uint32_t*)std}; 43 return &stds; 44 } 45 38 46 int roar_caps_to_msg(struct roar_message * mes, struct roar_caps * caps, void ** data) { 39 47 char * datap; … … 116 124 flags = 0; 117 125 118 if ( con == NULL ) 119 return -1; 126 if ( con == NULL ) { 127 roar_err_set(ROAR_ERROR_FAULT); 128 return -1; 129 } 120 130 121 131 if ( out != NULL ) … … 211 221 struct roar_stds * ret; 212 222 213 if ( len == 0 ) 223 if ( len == 0 ) { 224 roar_err_set(ROAR_ERROR_INVAL); 214 225 return NULL; 226 } 215 227 216 228 ret = roar_mm_malloc(sizeof(struct roar_stds)); … … 235 247 236 248 int roar_stds_free(struct roar_stds * stds) { 237 if ( stds == NULL ) 238 return -1; 249 if ( stds == NULL ) { 250 roar_err_set(ROAR_ERROR_FAULT); 251 return -1; 252 } 239 253 240 254 if ( stds->stds != NULL ) … … 260 274 int i; 261 275 276 if ( vendor == NULL ) { 277 roar_err_set(ROAR_ERROR_FAULT); 278 return -1; 279 } 280 262 281 for (i = 0; _libroar_std_vendors[i].name != NULL; i++) 263 282 if ( !strcasecmp(_libroar_std_vendors[i].name, vendor) ) 264 283 return _libroar_std_vendors[i].vendor; 265 284 285 roar_err_set(ROAR_ERROR_NOENT); 266 286 return -1; 267 287 } … … 274 294 return _libroar_std_vendors[i].name; 275 295 296 roar_err_set(ROAR_ERROR_NOENT); 276 297 return NULL; 277 298 }
Note: See TracChangeset
for help on using the changeset viewer.