version 1.30, 2008/12/29 17:59:08 |
version 1.31, 2009/01/23 17:38:15 |
|
|
if (f->refs > 0) |
if (f->refs > 0) |
return 0; |
return 0; |
DPRINTFN(3, "rpipe_out: %s\n", p->name); |
DPRINTFN(3, "rpipe_out: %s\n", p->name); |
|
|
if (ABUF_FULL(obuf) || !(f->state & FILE_ROK)) |
if (ABUF_FULL(obuf) || !(f->state & FILE_ROK)) |
return 0; |
return 0; |
data = abuf_wgetblk(obuf, &count, 0); |
data = abuf_wgetblk(obuf, &count, 0); |
|
|
|
|
p = aproc_new(&rpipe_ops, f->name); |
p = aproc_new(&rpipe_ops, f->name); |
p->u.io.file = f; |
p->u.io.file = f; |
f->rproc = p; |
f->rproc = p; |
return p; |
return p; |
} |
} |
|
|
|
|
DPRINTFN(3, "wpipe_out: %s\n", p->name); |
DPRINTFN(3, "wpipe_out: %s\n", p->name); |
|
|
if (!abuf_fill(ibuf)) { |
if (!abuf_fill(ibuf)) { |
DPRINTFN(3, "wpipe_out: fill failed\n"); |
DPRINTFN(3, "wpipe_out: fill failed\n"); |
return 0; |
return 0; |
} |
} |
if (ABUF_EMPTY(ibuf) || !(f->state & FILE_WOK)) |
if (ABUF_EMPTY(ibuf) || !(f->state & FILE_WOK)) |
|
|
return; |
return; |
|
|
vol = (ibuf->mixweight * ibuf->mixvol) >> ADATA_SHIFT; |
vol = (ibuf->mixweight * ibuf->mixvol) >> ADATA_SHIFT; |
ostart = ibuf->cmin - obuf->cmin; |
ostart = ibuf->cmin - obuf->cmin; |
onext = obuf->cmax - ibuf->cmax + ostart; |
onext = obuf->cmax - ibuf->cmax + ostart; |
icnt = ibuf->cmax - ibuf->cmin + 1; |
icnt = ibuf->cmax - ibuf->cmin + 1; |
odata += ostart; |
odata += ostart; |
|
|
mix_xrun(struct abuf *i, struct abuf *obuf) |
mix_xrun(struct abuf *i, struct abuf *obuf) |
{ |
{ |
unsigned fdrop; |
unsigned fdrop; |
|
|
if (i->mixodone > 0) |
if (i->mixodone > 0) |
return 1; |
return 1; |
if (i->xrun == XRUN_ERROR) { |
if (i->xrun == XRUN_ERROR) { |
|
|
|
|
DPRINTFN(4, "mix_in: used/len = %u/%u, done/todo = %u/%u\n", |
DPRINTFN(4, "mix_in: used/len = %u/%u, done/todo = %u/%u\n", |
ibuf->used, ibuf->len, ibuf->mixodone, obuf->mixitodo); |
ibuf->used, ibuf->len, ibuf->mixodone, obuf->mixitodo); |
|
|
if (!ABUF_ROK(ibuf)) |
if (!ABUF_ROK(ibuf)) |
return 0; |
return 0; |
odone = obuf->len; |
odone = obuf->len; |
|
|
obuf->used, obuf->len, obuf->mixitodo, obuf->len); |
obuf->used, obuf->len, obuf->mixitodo, obuf->len); |
|
|
if (!ABUF_WOK(obuf)) |
if (!ABUF_WOK(obuf)) |
return 0; |
return 0; |
odone = obuf->len; |
odone = obuf->len; |
for (i = LIST_FIRST(&p->ibuflist); i != NULL; i = inext) { |
for (i = LIST_FIRST(&p->ibuflist); i != NULL; i = inext) { |
inext = LIST_NEXT(i, ient); |
inext = LIST_NEXT(i, ient); |
|
|
} |
} |
idata += inext; |
idata += inext; |
} |
} |
abuf_wcommit(obuf, scount * obuf->bpf); |
abuf_wcommit(obuf, scount * obuf->bpf); |
obuf->subidone += scount * ibuf->bpf; |
obuf->subidone += scount * ibuf->bpf; |
DPRINTFN(4, "sub_bcopy: %u frames\n", scount); |
DPRINTFN(4, "sub_bcopy: %u frames\n", scount); |
} |
} |
|
|
{ |
{ |
struct abuf *i, *inext; |
struct abuf *i, *inext; |
unsigned idone; |
unsigned idone; |
|
|
if (!ABUF_ROK(ibuf)) |
if (!ABUF_ROK(ibuf)) |
return 0; |
return 0; |
idone = ibuf->len; |
idone = ibuf->len; |
|
|
unsigned iblksz; |
unsigned iblksz; |
unsigned ofr; |
unsigned ofr; |
unsigned c; |
unsigned c; |
short *ctxbuf, *ctx; |
short *ctxbuf, *ctx; |
unsigned ctx_start; |
unsigned ctx_start; |
unsigned icount, ocount; |
unsigned icount, ocount; |
|
|
|
|
void |
void |
resamp_ipos(struct aproc *p, struct abuf *ibuf, int delta) |
resamp_ipos(struct aproc *p, struct abuf *ibuf, int delta) |
{ |
{ |
struct abuf *obuf = LIST_FIRST(&p->obuflist); |
struct abuf *obuf = LIST_FIRST(&p->obuflist); |
long long ipos; |
long long ipos; |
int ifac, ofac; |
int ifac, ofac; |
|
|
|
|
} |
} |
#ifdef DEBUG |
#ifdef DEBUG |
if (debug_level > 0) { |
if (debug_level > 0) { |
fprintf(stderr, "dec_new: %s: ", p->name); |
fprintf(stderr, "dec_new: %s: ", p->name); |
aparams_print(par); |
aparams_print(par); |
fprintf(stderr, "\n"); |
fprintf(stderr, "\n"); |
} |
} |