source: roaraudio/roard/codecfilter_cmd.c @ 198:168dadfccd08

Last change on this file since 198:168dadfccd08 was 198:168dadfccd08, checked in by phi, 16 years ago

added closefh, lenclose parameters to lib_run_bg to support to close fhs we do not know about

File size: 689 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 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.