Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c10cd4a6 authored by James Dong's avatar James Dong Committed by Android (Google) Code Review
Browse files

Merge "Don't call virtual function in destructor of SurfaceMediaSource"

parents 327c8c2f f5a9f439
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);
};
+3 −3
Original line number Diff line number Diff line
@@ -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?