commit de98142d6b2d740026132822a49807d2a5cdf7d4
parent c1d5d2ffa698725f2a26b4ec55fc9ad869a85afc
Author: Pavel Renev <an2qzavok@gmail.com>
Date: Sun, 14 Jul 2024 22:34:22 +0000
amp: dont
Diffstat:
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/amp.c b/amp.c
@@ -16,7 +16,8 @@ enum {
MIdle = 0,
MSelectStart = 1,
- MSelect = 2,
+ MSelectIdle = 2,
+ MSelect = 3,
PStop = 0,
PPlay = 1,
@@ -195,11 +196,19 @@ threadselect(void *v)
}
switch (mmode) {
case MSelectStart:
- mmode = MSelect;
+ mmode = MSelectIdle;
+ se = p;
ss = p;
+ setselect(ss, se);
+ break;
+ case MSelectIdle:
+ if (p == se) break;
+ mmode = MSelect;
case MSelect:
se = p;
setselect(ss, se);
+ mmode = MSelectIdle;
+ break;
}
yield();
}