AudioStreamer icon indicating copy to clipboard operation
AudioStreamer copied to clipboard

State changed to AS_STOPPING too early, depending on kNumAQBufs*kAQDefaultBufSize

Open kdepp opened this issue 12 years ago • 0 comments

in handleReadFromStream, once eventType == kCFStreamEventEndEncountered, the music file has all been downloaded, it will change the state to AS_STOPPING or AS_STOPPED.

it seems that kCFStreamEventEndEncountered is trigged when all the music data left is in the audio buffer, and then try to CFReadStream again. So, the AS_STOPPING state depends on the whole buffer size, kNumAQBufs*kAQDefaultBufSize.

At that moment, audioBuffer may still have some buffers left to play. In my playlist app, it result in the early stop on the current song and switching to the next.

kdepp avatar Jan 24 '13 07:01 kdepp