Fixed progress is incorrect when file finishes playing half way through.
This commit is contained in:
parent
8508bc20be
commit
1f3c8eca52
|
|
@ -2,7 +2,7 @@
|
|||
AudioPlayer.m
|
||||
|
||||
Created by Thong Nguyen on 14/05/2012.
|
||||
http://http://code.google.com/p/bluecucumber
|
||||
https://github.com/tumtumtum/audjustable
|
||||
|
||||
Inspired by Matt Gallagher's AudioStreamer:
|
||||
https://github.com/mattgallagher/AudioStreamer
|
||||
|
|
@ -188,5 +188,6 @@ AudioQueueBufferRefLookupEntry;
|
|||
-(void) stop;
|
||||
-(void) flushStop;
|
||||
-(void) dispose;
|
||||
-(NSObject*) currentlyPlayingQueueItemId;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
AudioPlayer.m
|
||||
|
||||
Created by Thong Nguyen on 14/05/2012.
|
||||
http://http://code.google.com/p/bluecucumber
|
||||
https://github.com/tumtumtum/audjustable
|
||||
|
||||
Inspired by Matt Gallagher's AudioStreamer:
|
||||
https://github.com/mattgallagher/AudioStreamer
|
||||
|
|
@ -695,7 +695,10 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
|
|||
|
||||
if (currentlyPlayingEntry)
|
||||
{
|
||||
currentlyPlayingEntry->bytesPlayed += bufferIn->mAudioDataByteSize;
|
||||
if (!audioQueueFlushing)
|
||||
{
|
||||
currentlyPlayingEntry->bytesPlayed += bufferIn->mAudioDataByteSize;
|
||||
}
|
||||
}
|
||||
|
||||
int index = (int)bufferIn % audioQueueBufferRefLookupCount;
|
||||
|
|
@ -1752,4 +1755,16 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
|
|||
[self stopThread];
|
||||
}
|
||||
|
||||
-(NSObject*) currentlyPlayingQueueItemId
|
||||
{
|
||||
QueueEntry* entry = currentlyPlayingEntry;
|
||||
|
||||
if (entry == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
return entry.queueItemId;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
AudioPlayer.m
|
||||
|
||||
Created by Thong Nguyen on 14/05/2012.
|
||||
http://http://code.google.com/p/bluecucumber
|
||||
https://github.com/tumtumtum/audjustable
|
||||
|
||||
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
AudioPlayer.m
|
||||
|
||||
Created by Thong Nguyen on 14/05/2012.
|
||||
http://http://code.google.com/p/bluecucumber
|
||||
https://github.com/tumtumtum/audjustable
|
||||
|
||||
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
|
||||
|
||||
|
|
@ -49,6 +49,8 @@ static void ReadStreamCallbackProc(CFReadStreamRef stream, CFStreamEventType eve
|
|||
case kCFStreamEventHasBytesAvailable:
|
||||
[datasource dataAvailable];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
AudioPlayer.m
|
||||
|
||||
Created by Thong Nguyen on 14/05/2012.
|
||||
http://http://code.google.com/p/bluecucumber
|
||||
https://github.com/tumtumtum/audjustable
|
||||
|
||||
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
AudioPlayer.m
|
||||
|
||||
Created by Thong Nguyen on 14/05/2012.
|
||||
http://http://code.google.com/p/bluecucumber
|
||||
https://github.com/tumtumtum/audjustable
|
||||
|
||||
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
AudioPlayer.m
|
||||
|
||||
Created by Thong Nguyen on 14/05/2012.
|
||||
http://http://code.google.com/p/bluecucumber
|
||||
https://github.com/tumtumtum/audjustable
|
||||
|
||||
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
AudioPlayer.m
|
||||
|
||||
Created by Thong Nguyen on 14/05/2012.
|
||||
http://http://code.google.com/p/bluecucumber
|
||||
https://github.com/tumtumtum/audjustable
|
||||
|
||||
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
AudioPlayer.m
|
||||
|
||||
Created by Thong Nguyen on 14/05/2012.
|
||||
http://http://code.google.com/p/bluecucumber
|
||||
https://github.com/tumtumtum/audjustable
|
||||
|
||||
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
AudioPlayer.m
|
||||
|
||||
Created by Thong Nguyen on 14/05/2012.
|
||||
http://http://code.google.com/p/bluecucumber
|
||||
https://github.com/tumtumtum/audjustable
|
||||
|
||||
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue