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

Commit 6155085b authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Serialize calls to getFrameAtTime in the mediaserver

to avoid running out of memory.

Bug: 21277449
Change-Id: I7210806a24958f38d86aadab0310fc263e4c0edf
parent ad9ef61e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -191,10 +191,13 @@ status_t MetadataRetrieverClient::setDataSource(
    return ret;
}

Mutex MetadataRetrieverClient::sLock;

sp<IMemory> MetadataRetrieverClient::getFrameAtTime(int64_t timeUs, int option)
{
    ALOGV("getFrameAtTime: time(%lld us) option(%d)", timeUs, option);
    Mutex::Autolock lock(mLock);
    Mutex::Autolock glock(sLock);
    mThumbnail.clear();
    if (mRetriever == NULL) {
        ALOGE("retriever is not initialized");
+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ private:
    virtual ~MetadataRetrieverClient();

    mutable Mutex                          mLock;
    static  Mutex                          sLock;
    sp<MediaMetadataRetrieverBase>         mRetriever;
    pid_t                                  mPid;