Return 0 duration and progress if stop was requested
This commit is contained in:
parent
f60e16c804
commit
0b5b6ada88
|
|
@ -1030,7 +1030,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
|
|||
framesPerPacket = currentlyReadingEntry->audioStreamBasicDescription.mFramesPerPacket;
|
||||
}
|
||||
|
||||
if (currentlyReadingEntry->processedPacketsCount * framesPerPacket < currentlyReadingEntry->audioStreamBasicDescription.mSampleRate * 15 * currentlyReadingEntry->audioStreamBasicDescription.mChannelsPerFrame)
|
||||
if (currentlyReadingEntry->processedPacketsCount * framesPerPacket < currentlyReadingEntry->audioStreamBasicDescription.mSampleRate * 10 * currentlyReadingEntry->audioStreamBasicDescription.mChannelsPerFrame)
|
||||
{
|
||||
OSAtomicAdd32((int32_t)packetSize, ¤tlyReadingEntry->processedPacketsSizeTotal);
|
||||
OSAtomicIncrement32(¤tlyReadingEntry->processedPacketsCount);
|
||||
|
|
@ -1885,6 +1885,11 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (self.internalState == AudioPlayerInternalStateStopped)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
OSSpinLockLock(¤tEntryReferencesLock);
|
||||
|
||||
STKQueueEntry* entry = currentlyPlayingEntry;
|
||||
|
|
@ -1917,6 +1922,11 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
|
|||
return requestedSeekTime;
|
||||
}
|
||||
|
||||
if (self.internalState == AudioPlayerInternalStateStopped)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (newFileToPlay)
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -2842,8 +2852,6 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
|
|||
currentlyReadingEntry.lastFrameIndex = self->framesQueued;
|
||||
currentlyReadingEntry.lastByteIndex = audioPacketsReadCount;
|
||||
|
||||
LOGINFO(([NSString stringWithFormat:@"eof2: %lld %lld %d", audioPacketsReadCount, audioPacketsPlayedCount, numberOfBuffersUsed]));
|
||||
|
||||
if (numberOfBuffersUsed == 0 && currentlyReadingEntry == currentlyPlayingEntry)
|
||||
{
|
||||
seekToTimeWasRequested = NO;
|
||||
|
|
|
|||
Loading…
Reference in New Issue