sndiod: Use opt->dup and remove slot->dup.

This commit is contained in:
Alexandre Ratchov 2018-06-11 19:53:09 +02:00
parent 9eef11f53b
commit 72c6c0a9b8
2 changed files with 2 additions and 4 deletions

View File

@ -1431,7 +1431,7 @@ slot_allocbufs(struct slot *s)
s->mix.resampbuf = NULL; s->mix.resampbuf = NULL;
s->mix.join = 1; s->mix.join = 1;
s->mix.expand = 1; s->mix.expand = 1;
if (s->dup) { if (s->opt->dup) {
if (dev_nch > slot_nch) if (dev_nch > slot_nch)
s->mix.expand = dev_nch / slot_nch; s->mix.expand = dev_nch / slot_nch;
else if (dev_nch < slot_nch) else if (dev_nch < slot_nch)
@ -1466,7 +1466,7 @@ slot_allocbufs(struct slot *s)
s->sub.resampbuf = NULL; s->sub.resampbuf = NULL;
s->sub.join = 1; s->sub.join = 1;
s->sub.expand = 1; s->sub.expand = 1;
if (s->dup) { if (s->opt->dup) {
if (dev_nch > slot_nch) if (dev_nch > slot_nch)
s->sub.join = dev_nch / slot_nch; s->sub.join = dev_nch / slot_nch;
else if (dev_nch < slot_nch) else if (dev_nch < slot_nch)
@ -1685,7 +1685,6 @@ found:
s->xrun = XRUN_IGNORE; s->xrun = XRUN_IGNORE;
s->tstate = MMC_OFF; s->tstate = MMC_OFF;
} }
s->dup = s->opt->dup;
s->appbufsz = d->bufsz; s->appbufsz = d->bufsz;
s->round = d->round; s->round = d->round;
s->rate = d->rate; s->rate = d->rate;

View File

@ -71,7 +71,6 @@ struct slot {
} sub; } sub;
int xrun; /* underrun policy */ int xrun; /* underrun policy */
int skip; /* cycles to skip (for xrun) */ int skip; /* cycles to skip (for xrun) */
int dup; /* mono-to-stereo and alike */
#define SLOT_BUFSZ(s) \ #define SLOT_BUFSZ(s) \
((s)->appbufsz + (s)->dev->bufsz / (s)->dev->round * (s)->round) ((s)->appbufsz + (s)->dev->bufsz / (s)->dev->round * (s)->round)
int appbufsz; /* slot-side buffer size */ int appbufsz; /* slot-side buffer size */