version 1.81, 2021/01/28 11:10:00 |
version 1.82, 2021/01/28 11:15:31 |
|
|
case SLOT_START: |
case SLOT_START: |
case SLOT_READY: |
case SLOT_READY: |
case SLOT_RUN: |
case SLOT_RUN: |
slot_stop(s); |
|
/* PASSTHROUGH */ |
|
case SLOT_STOP: |
case SLOT_STOP: |
|
slot_stop(s, 0); |
break; |
break; |
} |
} |
dev_unref(s->dev); |
dev_unref(s->dev); |
|
|
* stop & detach if no data to drain. |
* stop & detach if no data to drain. |
*/ |
*/ |
void |
void |
slot_stop(struct slot *s) |
slot_stop(struct slot *s, int drain) |
{ |
{ |
#ifdef DEBUG |
#ifdef DEBUG |
if (log_level >= 3) { |
if (log_level >= 3) { |
|
|
} |
} |
|
|
if (s->pstate == SLOT_RUN) { |
if (s->pstate == SLOT_RUN) { |
if (s->mode & MODE_PLAY) { |
if ((s->mode & MODE_PLAY) && drain) { |
/* |
/* |
* Don't detach, dev_cycle() will do it for us |
* Don't detach, dev_cycle() will do it for us |
* when the buffer is drained. |
* when the buffer is drained. |
|
|
s->pstate = SLOT_STOP; |
s->pstate = SLOT_STOP; |
return; |
return; |
} |
} |
|
slot_detach(s); |
|
} else if (s->pstate == SLOT_STOP) { |
slot_detach(s); |
slot_detach(s); |
} else { |
} else { |
#ifdef DEBUG |
#ifdef DEBUG |