Changeset 458:7deaeb20da4f in roaraudio
- Timestamp:
- 08/12/08 05:55:59 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/xmms/roar.c
r457 r458 7 7 #include <stdio.h> 8 8 #include <string.h> 9 #include <pthread.h>10 9 11 10 #include "xmms/plugin.h" … … 74 73 long unsigned int bps; 75 74 int session; 76 int next_test;77 75 int pause; 78 int updateing;79 76 } g_inst; 80 77 … … 86 83 g_inst.state = 0; 87 84 g_inst.server = NULL; 88 g_inst.updateing = 0;89 85 g_inst.session = ctrlsocket_get_session_id(); 90 86 ROAR_DBG("roar_init(*) = (void)"); … … 97 93 void roar_write(void *ptr, int length) { 98 94 int r; 99 int need_update = 0;100 pthread_t thread;101 102 if ( g_inst.next_test < 1 ) {103 need_update = 1;104 g_inst.next_test = g_inst.bps;105 pthread_create(&thread, NULL, (void (*)(void*))roar_chk_metadata, NULL);106 //roar_socket_nonblock(g_inst.data_fh, ROAR_SOCKET_NONBLOCK);107 }108 95 109 96 if ( g_inst.pause ) … … 115 102 ptr += r; 116 103 length -= r; 117 g_inst.next_test -= r;118 104 } else { 119 if ( errno == EAGAIN ) { 120 roar_socket_nonblock(g_inst.data_fh, ROAR_SOCKET_BLOCK); 121 } else { 122 return; 123 } 105 return; 124 106 } 125 }126 127 128 if ( need_update ) {129 //roar_socket_nonblock(g_inst.data_fh, ROAR_SOCKET_BLOCK);130 pthread_join(thread, NULL);131 107 } 132 108 } … … 180 156 181 157 g_inst.bps = nch * rate * bits / 8; 182 g_inst.next_test = g_inst.bps;183 158 184 159 if ( (g_inst.data_fh = roar_simple_new_stream_obj(&(g_inst.con), &(g_inst.stream), … … 259 234 int pos; 260 235 261 g_inst.updateing++;262 263 if ( g_inst.updateing > 1 ) {264 g_inst.updateing--;265 return -1;266 }267 268 236 pos = xmms_remote_get_playlist_pos(g_inst.session); 269 237 … … 299 267 } 300 268 301 g_inst.updateing--;302 269 return 0; 303 270 }
Note: See TracChangeset
for help on using the changeset viewer.