version 1.4, 2008/06/02 17:05:12 |
version 1.5, 2008/06/02 17:06:36 |
|
|
ocount = obuf->mixtodo; |
ocount = obuf->mixtodo; |
for (i = LIST_FIRST(&p->ibuflist); i != LIST_END(&p->ibuflist); i = inext) { |
for (i = LIST_FIRST(&p->ibuflist); i != LIST_END(&p->ibuflist); i = inext) { |
inext = LIST_NEXT(i, ient); |
inext = LIST_NEXT(i, ient); |
if (!ABUF_ROK(i) && i->mixdone == 0) { |
if (!ABUF_ROK(i)) { |
drop = obuf->mixtodo; |
if ((p->u.mix.flags & MIX_DROP) && i->mixdone == 0) { |
i->mixdone += drop; |
if (i->xrun == XRUN_ERROR) { |
i->mixdrop += drop; |
mix_rm(p, i); |
DPRINTF("mix_out: xrun, drop = %u\n", i->mixdrop); |
abuf_hup(i); |
|
continue; |
|
} |
|
drop = obuf->mixtodo; |
|
i->mixdone += drop; |
|
if (i->xrun == XRUN_SYNC) |
|
i->mixdrop += drop; |
|
DPRINTF("mix_out: xrun, drop = %u\n", |
|
i->mixdrop); |
|
} |
} else |
} else |
mix_badd(i, obuf); |
mix_badd(i, obuf); |
if (ocount > i->mixdone) |
if (ocount > i->mixdone) |
|
|
ibuf->mixdone = 0; |
ibuf->mixdone = 0; |
ibuf->mixdrop = 0; |
ibuf->mixdrop = 0; |
ibuf->mixvol = ADATA_UNIT; |
ibuf->mixvol = ADATA_UNIT; |
|
ibuf->xrun = XRUN_IGNORE; |
} |
} |
|
|
void |
void |
|
|
struct aproc *p; |
struct aproc *p; |
|
|
p = aproc_new(&mix_ops, "softmix"); |
p = aproc_new(&mix_ops, "softmix"); |
|
p->u.mix.flags = 0; |
return p; |
return p; |
} |
} |
|
|
|
|
done = ibuf->used; |
done = ibuf->used; |
for (i = LIST_FIRST(&p->obuflist); i != LIST_END(&p->obuflist); i = inext) { |
for (i = LIST_FIRST(&p->obuflist); i != LIST_END(&p->obuflist); i = inext) { |
inext = LIST_NEXT(i, oent); |
inext = LIST_NEXT(i, oent); |
if (!ABUF_WOK(i) && i->subdone == 0) { |
if (!ABUF_WOK(i)) { |
drop = ibuf->used; |
if ((p->u.sub.flags & SUB_DROP) && i->subdone == 0) { |
i->subdrop += drop; |
if (i->xrun == XRUN_ERROR) { |
i->subdone += drop; |
sub_rm(p, i); |
DPRINTF("sub_in: xrun, drop = %u\n", i->subdrop); |
abuf_eof(i); |
|
continue; |
|
} |
|
drop = ibuf->used; |
|
if (i->xrun == XRUN_SYNC) |
|
i->subdrop += drop; |
|
i->subdone += drop; |
|
DPRINTF("sub_in: xrun, drop = %u\n", |
|
i->subdrop); |
|
} |
} else { |
} else { |
sub_bcopy(ibuf, i); |
sub_bcopy(ibuf, i); |
abuf_flush(i); |
abuf_flush(i); |
} |
} |
#ifdef sub_xrun_disabled |
|
if (!ABUF_WOK(i)) |
if (!ABUF_WOK(i)) |
again = 0; |
again = 0; |
#endif |
|
if (done > i->subdone) |
if (done > i->subdone) |
done = i->subdone; |
done = i->subdone; |
} |
} |
|
|
memset(odata, 0, ocount); |
memset(odata, 0, ocount); |
obuf->used += ocount; |
obuf->used += ocount; |
obuf->subdrop -= ocount; |
obuf->subdrop -= ocount; |
DPRINTF("sub_out: catched, drop = %u\n", obuf->subdrop); |
DPRINTF("sub_out: catch, drop = %u\n", obuf->subdrop); |
} |
} |
|
|
if (obuf->subdone >= ibuf->used) |
if (obuf->subdone >= ibuf->used) |
|
|
{ |
{ |
obuf->subdone = 0; |
obuf->subdone = 0; |
obuf->subdrop = 0; |
obuf->subdrop = 0; |
|
obuf->xrun = XRUN_IGNORE; |
} |
} |
|
|
struct aproc_ops sub_ops = { |
struct aproc_ops sub_ops = { |
|
|
struct aproc *p; |
struct aproc *p; |
|
|
p = aproc_new(&sub_ops, "copy"); |
p = aproc_new(&sub_ops, "copy"); |
|
p->u.sub.flags = 0; |
return p; |
return p; |
} |
} |
|
|