diff options
author | James Dong <jdong@google.com> | 2012-02-04 06:19:50 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2012-02-06 12:17:44 -0800 |
commit | 60c2b4ece6528d6d3f4e9e2c7e45772b65c4b87d (patch) | |
tree | 3df99c3e31172c3ffcb9361a46b68890891f5a0b | |
parent | f9289a4ca88d8f72cb0d6b3ca16fbc44ef4a2aeb (diff) | |
download | frameworks_av-60c2b4ece6528d6d3f4e9e2c7e45772b65c4b87d.zip frameworks_av-60c2b4ece6528d6d3f4e9e2c7e45772b65c4b87d.tar.gz frameworks_av-60c2b4ece6528d6d3f4e9e2c7e45772b65c4b87d.tar.bz2 |
Don't call virtual function in destructor of SurfaceMediaSource
Change-Id: I3cbc2b1222335b61c814b5cdcfaefa495148b0ec
-rw-r--r-- | include/media/stagefright/SurfaceMediaSource.h | 4 | ||||
-rw-r--r-- | media/libstagefright/SurfaceMediaSource.cpp | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h index d0940bb..54baab6 100644 --- a/include/media/stagefright/SurfaceMediaSource.h +++ b/include/media/stagefright/SurfaceMediaSource.h @@ -58,7 +58,7 @@ public: // For the MediaSource interface for use by StageFrightRecorder: virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); + virtual status_t stop() { return reset(); } virtual status_t read( MediaBuffer **buffer, const ReadOptions *options = NULL); virtual sp<MetaData> getFormat(); @@ -359,6 +359,8 @@ private: Condition mFrameAvailableCondition; Condition mFrameCompleteCondition; + status_t reset(); + // Avoid copying and equating and default constructor DISALLOW_IMPLICIT_CONSTRUCTORS(SurfaceMediaSource); }; diff --git a/media/libstagefright/SurfaceMediaSource.cpp b/media/libstagefright/SurfaceMediaSource.cpp index 2233d1b..d068381 100644 --- a/media/libstagefright/SurfaceMediaSource.cpp +++ b/media/libstagefright/SurfaceMediaSource.cpp @@ -60,7 +60,7 @@ SurfaceMediaSource::SurfaceMediaSource(uint32_t bufW, uint32_t bufH) : SurfaceMediaSource::~SurfaceMediaSource() { ALOGV("SurfaceMediaSource::~SurfaceMediaSource"); if (!mStopped) { - stop(); + reset(); } } @@ -716,9 +716,9 @@ status_t SurfaceMediaSource::start(MetaData *params) } -status_t SurfaceMediaSource::stop() +status_t SurfaceMediaSource::reset() { - ALOGV("Stop"); + ALOGV("Reset"); Mutex::Autolock lock(mMutex); // TODO: Add waiting on mFrameCompletedCondition here? |