Merge branch 'danielgindi-duration_and_progress'
This commit is contained in:
commit
4c7ce6c4ec
|
|
@ -49,6 +49,7 @@
|
|||
@property (readonly) SInt64 position;
|
||||
@property (readonly) SInt64 length;
|
||||
@property (readonly) BOOL hasBytesAvailable;
|
||||
@property (nonatomic, readwrite, assign) double durationHint;
|
||||
@property (readwrite, unsafe_unretained) id<STKDataSourceDelegate> delegate;
|
||||
|
||||
-(BOOL) registerForEvents:(NSRunLoop*)runLoop;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
volatile int processedPacketsCount;
|
||||
volatile int processedPacketsSizeTotal;
|
||||
AudioStreamBasicDescription audioStreamBasicDescription;
|
||||
double durationHint;
|
||||
}
|
||||
|
||||
@property (readonly) UInt64 audioDataLengthInBytes;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
self.dataSource = dataSourceIn;
|
||||
self.queueItemId = queueItemIdIn;
|
||||
self->lastFrameQueued = -1;
|
||||
self->durationHint = dataSourceIn.durationHint;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
|
@ -60,6 +61,8 @@
|
|||
|
||||
-(double) duration
|
||||
{
|
||||
if (durationHint > 0.0) return durationHint;
|
||||
|
||||
if (self->sampleRate <= 0)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue