Cog Audio: Terminate queueing when stopping
The end of input queueing, which can go nuts when there are a lot of short files, should be terminated when the user asks the player to stop. Signed-off-by: Christopher Snowhill <kode54@gmail.com>CQTexperiment
parent
074e4115dd
commit
002be384ff
|
@ -47,6 +47,8 @@
|
|||
atomic_int refCount;
|
||||
|
||||
int currentPlaybackStatus;
|
||||
|
||||
BOOL shouldContinue;
|
||||
}
|
||||
|
||||
- (id)init;
|
||||
|
|
|
@ -251,6 +251,8 @@
|
|||
|
||||
- (void)setShouldContinue:(BOOL)s
|
||||
{
|
||||
shouldContinue = s;
|
||||
|
||||
if (bufferChain)
|
||||
[bufferChain setShouldContinue:s];
|
||||
|
||||
|
@ -344,7 +346,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
while (duration >= 30.0)
|
||||
while (duration >= 30.0 && shouldContinue)
|
||||
{
|
||||
[semaphore wait];
|
||||
if (atomic_load_explicit(&resettingNow, memory_order_relaxed)) {
|
||||
|
@ -416,7 +418,7 @@
|
|||
|
||||
lastChain = nil;
|
||||
|
||||
while (![newChain open:nextStream withOutputFormat:[output format] withRGInfo:nextStreamRGInfo])
|
||||
while (shouldContinue && ![newChain open:nextStream withOutputFormat:[output format] withRGInfo:nextStreamRGInfo])
|
||||
{
|
||||
if (nextStream == nil)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue