summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-09-15 14:51:49 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-09-15 14:51:49 -0700
commite78d3bba024e979715383e2c2b4b086749508090 (patch)
tree1022d971179609d476975545bde49dac8198054b /media
parent3b93208243d6f4caab3f0b27372e95c9be8d9893 (diff)
parent67e9269eaeab41a6c9a18794ebb32cbd1414381c (diff)
downloadframeworks_av-e78d3bba024e979715383e2c2b4b086749508090.zip
frameworks_av-e78d3bba024e979715383e2c2b4b086749508090.tar.gz
frameworks_av-e78d3bba024e979715383e2c2b4b086749508090.tar.bz2
Merge "Fix audio input sample timestamp when audio driver loses audio samples" into gingerbread
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/AudioSource.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp
index 8d7ada3..29f16d8 100644
--- a/media/libstagefright/AudioSource.cpp
+++ b/media/libstagefright/AudioSource.cpp
@@ -256,6 +256,8 @@ status_t AudioSource::read(
if (numLostBytes > kMaxBufferSize) {
mPrevLostBytes = numLostBytes - kMaxBufferSize;
numLostBytes = kMaxBufferSize;
+ } else {
+ mPrevLostBytes = 0;
}
CHECK_EQ(numLostBytes & 1, 0);
@@ -275,8 +277,9 @@ status_t AudioSource::read(
memset(buffer->data(), 0, numLostBytes);
buffer->set_range(0, numLostBytes);
if (numFramesRecorded == 0) {
- buffer->meta_data()->setInt64(kKeyTime, mStartTimeUs);
+ buffer->meta_data()->setInt64(kKeyAnchorTime, mStartTimeUs);
}
+ buffer->meta_data()->setInt64(kKeyTime, mStartTimeUs + mPrevSampleTimeUs);
buffer->meta_data()->setInt64(kKeyDriftTime, readTimeUs - mInitialReadTimeUs);
mPrevSampleTimeUs = timestampUs;
*out = buffer;