summaryrefslogtreecommitdiffstats
path: root/libvideoeditor/lvpp
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2011-11-16 11:39:05 +0800
committerChih-Chung Chang <chihchung@google.com>2011-11-16 11:39:05 +0800
commit83a4cc4e3a404a02fa4af496ff48ee51581fb098 (patch)
treeb4c33f0ec38521c31bb0e75ea3364ac05a665419 /libvideoeditor/lvpp
parent3b8c0478e92f0c52a3bb2eca2d34effd04cf61e7 (diff)
parent482cedda9164b9f376dbe47644e33eb07db5b996 (diff)
downloadframeworks_av-83a4cc4e3a404a02fa4af496ff48ee51581fb098.zip
frameworks_av-83a4cc4e3a404a02fa4af496ff48ee51581fb098.tar.gz
frameworks_av-83a4cc4e3a404a02fa4af496ff48ee51581fb098.tar.bz2
resolved conflicts for merge of fbb122bf to master
Change-Id: I607e6b11e925ba858d2a0856117e2fcb68bed963
Diffstat (limited to 'libvideoeditor/lvpp')
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorSRC.cpp11
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorSRC.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/libvideoeditor/lvpp/VideoEditorSRC.cpp b/libvideoeditor/lvpp/VideoEditorSRC.cpp
index 194e3a6..5ea95b0 100755
--- a/libvideoeditor/lvpp/VideoEditorSRC.cpp
+++ b/libvideoeditor/lvpp/VideoEditorSRC.cpp
@@ -41,6 +41,7 @@ VideoEditorSRC::VideoEditorSRC(const sp<MediaSource> &source) {
mBuffer = NULL;
mLeftover = 0;
mFormatChanged = false;
+ mStopPending = false;
mSeekMode = ReadOptions::SEEK_PREVIOUS_SYNC;
// Input Source validation
@@ -127,6 +128,11 @@ status_t VideoEditorSRC::read(
// Resample to target quality
mResampler->resample(pTmpBuffer, outFrameCnt, this);
+ if (mStopPending) {
+ stop();
+ mStopPending = false;
+ }
+
// Change resampler and retry if format change happened
if (mFormatChanged) {
mFormatChanged = false;
@@ -220,7 +226,10 @@ status_t VideoEditorSRC::getNextBuffer(AudioBufferProvider::Buffer *pBuffer) {
// EOS or some other error
if (err != OK) {
ALOGV("EOS or some err: %d", err);
- stop();
+ // We cannot call stop() here because stop() will release the
+ // AudioResampler, and we are in a callback of the AudioResampler.
+ // So just remember the fact and let read() call stop().
+ mStopPending = true;
return err;
}
diff --git a/libvideoeditor/lvpp/VideoEditorSRC.h b/libvideoeditor/lvpp/VideoEditorSRC.h
index a5e8e22..c61b7c1 100755
--- a/libvideoeditor/lvpp/VideoEditorSRC.h
+++ b/libvideoeditor/lvpp/VideoEditorSRC.h
@@ -78,6 +78,7 @@ class VideoEditorSRC : public MediaSource , public AudioBufferProvider {
MediaBuffer* mBuffer;
int32_t mLeftover;
bool mFormatChanged;
+ bool mStopPending;
int64_t mInitialTimeStampUs;
int64_t mAccuOutBufferSize;