source: roaraudio/roard/codecfilter_cmd.c @ 197:6410a072b96d

Last change on this file since 197:6410a072b96d was 197:6410a072b96d, checked in by phi, 16 years ago

close input fh an do not just loose all refrences

File size: 679 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) == -1 )
15  return -1;
16
17 close(((struct roar_stream*)info)->fh);
18 ((struct roar_stream*)info)->fh = socks[0];
19 ((struct roar_stream*)info)->info.codec = ROAR_CODEC_DEFAULT;
20 close(socks[1]);
21
22 info->codecfilter = -1;
23
24 return 0;
25}
26
27//ll
Note: See TracBrowser for help on using the repository browser.