Changeset 4679:7a1dfd0bebba in roaraudio
- Timestamp:
- 12/22/10 01:49:32 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/clients.c
r4678 r4679 26 26 #include "roard.h" 27 27 28 struct roard_proto g_proto[ ] = {28 struct roard_proto g_proto[8] = { 29 29 #ifndef ROAR_WITHOUT_DCOMP_EMUL_ESD 30 30 #ifdef ROAR_HAVE_H_ESD … … 582 582 default: 583 583 rv = -1; 584 for (i = 0; i < (sizeof(g_proto)/sizeof(*g_proto)); i++) {584 for (i = 0; g_proto[i].proto != -1; i++) { 585 585 if ( g_proto[i].proto == c->proto ) { 586 586 rv = g_proto[i].check_client(id, NULL); … … 669 669 return -1; 670 670 } 671 672 // proto support 673 int clients_register_proto(struct roard_proto * proto) { 674 const size_t len = sizeof(g_proto)/sizeof(*g_proto); 675 size_t i; 676 677 if ( proto == NULL ) 678 return -1; 679 680 for (i = 0; g_proto[i].proto != -1; i++); 681 682 // i is now at pos of current EOS entry. 683 684 // test if we have space for one more entry: 685 if ( (i+1) >= len ) 686 return -1; 687 688 memcpy(&(g_proto[i]), proto, sizeof(*g_proto)); 689 690 i++; 691 692 memset(&(g_proto[i]), 0, sizeof(*g_proto)); 693 g_proto[i].proto = -1; 694 695 return 0; 696 } 697 671 698 672 699 int client_stream_exec (int client, int stream) { -
roard/include/client.h
r4678 r4679 99 99 int clients_send_filter(struct roar_audio_info * sa, uint32_t pos); 100 100 101 // proto support 102 int clients_register_proto(struct roard_proto * proto); 103 101 104 // stream functions 102 105 int client_stream_exec (int client, int stream);
Note: See TracChangeset
for help on using the changeset viewer.