source: roaraudio/roard/codecfilter_cmd.c @ 199:6cb095cfd3d2

Last change on this file since 199:6cb095cfd3d2 was 199:6cb095cfd3d2, checked in by phi, 16 years ago

don't close input stream as it may be an execed one

File size: 769 bytes
Line 
1//codecfilter_cmd.c:
2
3#include "roard.h"
4
5int cf_cmd_open(CODECFILTER_USERDATA_T * inst, int codec,
6                                             struct roar_stream_server * info,
7                                             struct roar_codecfilter   * filter) {
8 int socks[2];
9
10 if ( socketpair(AF_UNIX, SOCK_STREAM, 0, socks) == -1 ) {
11  return -1;
12 }
13
14 if ( lib_run_bg(filter->options, ((struct roar_stream*)info)->fh, socks[1], ROAR_STDERR, socks, 2) == -1 )
15  return -1;
16
17// we can't close the stream in case this is an execed stream of some client.
18// close(((struct roar_stream*)info)->fh);
19 ((struct roar_stream*)info)->fh = socks[0];
20 ((struct roar_stream*)info)->info.codec = ROAR_CODEC_DEFAULT;
21 close(socks[1]);
22
23 info->codecfilter = -1;
24
25 return 0;
26}
27
28//ll
Note: See TracBrowser for help on using the repository browser.