diff options
author | Rajneesh Chowdury <rajneeshc@google.com> | 2011-02-21 15:43:33 -0800 |
---|---|---|
committer | Rajneesh Chowdury <rajneeshc@google.com> | 2011-02-22 13:42:26 -0800 |
commit | 1c97d9ab52a288d24ea54499de435277cc1a3d68 (patch) | |
tree | d15a87a64ff1cf292d4d0704f483cb1c61ede0c7 /libvideoeditor/lvpp/DummyAudioSource.cpp | |
parent | 7e006bd24cccffb9c9fd48fd3b2709b6639bc5f1 (diff) | |
download | frameworks_av-1c97d9ab52a288d24ea54499de435277cc1a3d68.zip frameworks_av-1c97d9ab52a288d24ea54499de435277cc1a3d68.tar.gz frameworks_av-1c97d9ab52a288d24ea54499de435277cc1a3d68.tar.bz2 |
Fix for 3369917 Audio skips at clip edit points
Change-Id: Iba66585cc2e679475d8db529d6113586b58e626e
Diffstat (limited to 'libvideoeditor/lvpp/DummyAudioSource.cpp')
-rwxr-xr-x | libvideoeditor/lvpp/DummyAudioSource.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libvideoeditor/lvpp/DummyAudioSource.cpp b/libvideoeditor/lvpp/DummyAudioSource.cpp index 04f8dc9..70f5944 100755 --- a/libvideoeditor/lvpp/DummyAudioSource.cpp +++ b/libvideoeditor/lvpp/DummyAudioSource.cpp @@ -97,7 +97,12 @@ DummyAudioSource::~DummyAudioSource () { LOG2("DummyAudioSource::~DummyAudioSource"); } - +void DummyAudioSource::setDuration (int64_t audioDurationUs) { + Mutex::Autolock autoLock(mLock); + LOG2("SetDuration %lld", mAudioDurationUs); + mAudioDurationUs += audioDurationUs; + LOG2("SetDuration %lld", mAudioDurationUs); +} status_t DummyAudioSource::start(MetaData *params) { status_t err = OK; @@ -143,7 +148,7 @@ sp<MetaData> DummyAudioSource::getFormat() { meta->setInt32(kKeySampleRate, mSamplingRate); meta->setInt64(kKeyDuration, mFrameDurationUs); - meta->setCString(kKeyDecoderComponent, "DummyAudioSource"); + meta->setCString(kKeyDecoderComponent, "DummyAudioSource"); return meta; } @@ -159,11 +164,14 @@ status_t DummyAudioSource::read( MediaBuffer **out, const MediaSource::ReadOptio if (options && options->getSeekTo(&seekTimeUs, &mode)) { CHECK(seekTimeUs >= 0); mTimeStampUs = seekTimeUs; - } - - if (mTimeStampUs >= mAudioDurationUs) { - *out = NULL; - return ERROR_END_OF_STREAM; + } + { + Mutex::Autolock autoLock(mLock); + if (mTimeStampUs >= mAudioDurationUs) { + *out = NULL; + LOGI("EOS reached"); + return ERROR_END_OF_STREAM; + } } err = mBufferGroup->acquire_buffer(&buffer); |