mStreamType, mLeftVolume, mRightVolume);
result.append(buffer);
snprintf(buffer, 255, " msec per frame(%f), latency (%d)\n",
- mMsecsPerFrame, mLatency);
+ mMsecsPerFrame, (mTrack != 0) ? mTrack->latency() : -1);
result.append(buffer);
snprintf(buffer, 255, " aux effect id(%d), send level (%f)\n",
mAuxEffectId, mSendLevel);
mRightVolume = 1.0;
mPlaybackRatePermille = 1000;
mSampleRateHz = 0;
- mLatency = 0;
mMsecsPerFrame = 0;
mAuxEffectId = 0;
mSendLevel = 0.0;
uint32_t MediaPlayerService::AudioOutput::latency () const
{
- return mLatency;
+ if (mTrack == 0) return 0;
+ return mTrack->latency();
}
float MediaPlayerService::AudioOutput::msecsPerFrame() const
mSampleRateHz = sampleRate;
mMsecsPerFrame = mPlaybackRatePermille / (float) sampleRate;
- mLatency = t->latency();
mTrack = t;
status_t res = t->setSampleRate(mPlaybackRatePermille * mSampleRateHz / 1000);
break;
}
+ if (mAudioSink != NULL) {
+ mLatencyUs = (int64_t)mAudioSink->latency() * 1000;
+ } else {
+ mLatencyUs = (int64_t)mAudioTrack->latency() * 1000;
+ }
+
CHECK(mInputBuffer->meta_data()->findInt64(
kKeyTime, &mPositionTimeMediaUs));