Changeset 5465:d5e7bc292531 in roaraudio for libroar/basic.c
- Timestamp:
- 03/31/12 02:30:26 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/basic.c
r5428 r5465 451 451 452 452 int roar_connect_none (struct roar_connection * con) { 453 struct roar_libroar_config * config = roar_libroar_get_config(); 454 453 455 if ( con == NULL ) { 454 456 roar_err_set(ROAR_ERROR_INVAL); … … 459 461 con->refc = 1; 460 462 con->flags = ROAR_CON_FLAGS_NONE; 461 con->version = 0;463 con->version = _ROAR_MESSAGE_VERSION; 462 464 con->cb_userdata = NULL; 463 465 con->cb = NULL; … … 470 472 471 473 // con->flags |= ROAR_CON_FLAGS_VIO; 474 475 if ( config->protocolversion != -1 ) 476 roar_set_connection_version(con, config->protocolversion); 472 477 473 478 roar_err_set(ROAR_ERROR_NONE); … … 616 621 void * userdata), 617 622 void * userdata) { 618 if ( con == NULL ) 619 return -1; 623 if ( con == NULL ) { 624 roar_err_set(ROAR_ERROR_FAULT); 625 return -1; 626 } 620 627 621 628 con->cb = cb; 622 629 con->cb_userdata = userdata; 630 631 return 0; 632 } 633 634 int roar_set_connection_version(struct roar_connection * con, int version) { 635 if ( con == NULL ) { 636 roar_err_set(ROAR_ERROR_FAULT); 637 return -1; 638 } 639 640 if ( version == -1 ) 641 version = _ROAR_MESSAGE_VERSION; 642 643 if ( version < 0 ) { 644 roar_err_set(ROAR_ERROR_INVAL); 645 return -1; 646 } 647 648 con->version = version; 649 650 if ( version == 2 ) { 651 con->flags |= ROAR_CON_FLAGS_SUPPORT_V2; 652 } 623 653 624 654 return 0;
Note: See TracChangeset
for help on using the changeset viewer.