Changeset 1660:99bfd21f00ef in roaraudio for libroar
- Timestamp:
- 05/08/09 16:56:40 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libroar
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/basic.c
r1475 r1660 187 187 memset(con, 0, sizeof(struct roar_connection)); 188 188 189 con-> fh = fh;189 con->__fh = fh; 190 190 191 191 roar_errno = ROAR_ERROR_NONE; 192 192 return 0; 193 } 194 195 int roar_get_connection_fh (struct roar_connection * con) { 196 return con->__fh; 193 197 } 194 198 … … 204 208 205 209 #ifdef ROAR_HAVE_IO_POSIX 206 close( con->fh);207 #endif 208 209 con->fh = -1;210 close(roar_get_connection_fh(con)); 211 #endif 212 213 roar_connect_fh(con, -2); 210 214 211 215 roar_errno = ROAR_ERROR_NONE; … … 256 260 struct roar_vio_calls vio; 257 261 258 if ( roar_vio_open_fh_socket(&vio, con->fh) == -1 )262 if ( roar_vio_open_fh_socket(&vio, roar_get_connection_fh(con)) == -1 ) 259 263 return -1; 260 264 … … 298 302 struct roar_vio_calls vio; 299 303 300 if ( roar_vio_open_fh_socket(&vio, con->fh) == -1 )304 if ( roar_vio_open_fh_socket(&vio, roar_get_connection_fh(con)) == -1 ) 301 305 return -1; 302 306 … … 385 389 struct roar_vio_calls vio; 386 390 387 if ( roar_vio_open_fh_socket(&vio, con->fh) == -1 )391 if ( roar_vio_open_fh_socket(&vio, roar_get_connection_fh(con)) == -1 ) 388 392 return -1; 389 393 -
libroar/file.c
r1474 r1660 203 203 struct roar_stream localstream[1]; 204 204 205 // FIXME: check error cases 206 205 207 if ( !s ) 206 208 s = localstream; … … 255 257 } 256 258 257 ROAR_SHUTDOWN(con->fh, SHUT_RD); 258 259 out = con->fh; 259 if ( (out = roar_get_connection_fh(con)) == -1 ) { 260 close(in); 261 return -1; 262 } 263 264 ROAR_SHUTDOWN(out, SHUT_RD); 260 265 } else { 261 266 if ( !(passfh && seek) ) { -
libroar/simple.c
r1476 r1660 65 65 int roar_simple_stream_obj (struct roar_stream * s, int rate, int channels, int bits, int codec, char * server, int dir, char * name) { 66 66 struct roar_connection con; 67 int ret; 67 68 68 69 if ( roar_simple_connect(&con, server, name) == -1 ) { … … 87 88 } 88 89 90 if ( (ret = roar_get_connection_fh(&con)) == -1 ) { 91 roar_disconnect(&con); 92 return -1; 93 } 94 89 95 if ( dir == ROAR_DIR_PLAY ) { 90 ROAR_SHUTDOWN( con.fh, SHUT_RD);96 ROAR_SHUTDOWN(ret, SHUT_RD); 91 97 } else if ( dir == ROAR_DIR_MONITOR || dir == ROAR_DIR_RECORD ) { 92 ROAR_SHUTDOWN( con.fh, SHUT_WR);93 } 94 95 return con.fh;98 ROAR_SHUTDOWN(ret, SHUT_WR); 99 } 100 101 return ret; 96 102 } 97 103 … … 146 152 147 153 #ifdef ROAR_HAVE_BSDSOCKETS 148 if ( getsockname( con->fh, (struct sockaddr *)&socket_addr, &len) == -1 ) {154 if ( getsockname(roar_get_connection_fh(con), (struct sockaddr *)&socket_addr, &len) == -1 ) { 149 155 return -1; 150 156 } … … 339 345 struct roar_connection con; 340 346 341 con.fh = fh; 347 if ( roar_connect_fh(&con, fh) == -1 ) 348 return -1; 342 349 343 350 return roar_get_standby(&con); -
libroar/stream.c
r1475 r1660 203 203 int roar_stream_passfh (struct roar_connection * con, struct roar_stream * s, int fh) { 204 204 struct roar_message m; 205 int confh; 205 206 206 207 m.cmd = ROAR_CMD_PASSFH; … … 210 211 211 212 ROAR_DBG("roar_stream_passfh(con={.fh=%i,...}, s={.id=%i,...}, fh=%i) = ?", con->fh, s->id, fh); 213 214 if ( (confh = roar_get_connection_fh(con)) == -1 ) 215 return -1; 212 216 213 217 if ( roar_send_message(con, &m, NULL) == -1 ) { … … 218 222 ROAR_DBG("roar_stream_passfh(*): msg send"); 219 223 220 if ( roar_socket_send_fh(con ->fh, fh, NULL, 0) == -1 )224 if ( roar_socket_send_fh(confh, fh, NULL, 0) == -1 ) 221 225 return -1; 222 226
Note: See TracChangeset
for help on using the changeset viewer.