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

Commit 27a6ba7b authored by Ashish Jain's avatar Ashish Jain Committed by Gerrit - the friendly Code Review server
Browse files

libmediaplayerService: Handle error on Player start

- Player start can return error in case of invalid heap id
for SoundPool usecase.
- Handle this error case so that we do not wait for ever
on AudioCache wait.

CRs-Fixed: 782055
Change-Id: I467c368e15caef509ed101dfd934386c665322b0
parent f228faaf
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1350,7 +1350,7 @@ status_t MediaPlayerService::decode(
    if (cache->wait() != NO_ERROR) goto Exit;

    ALOGV("start");
    player->start();
    if (player->start() != NO_ERROR) goto Exit;

    ALOGV("wait for playback complete");
    cache->wait();
@@ -1405,7 +1405,7 @@ status_t MediaPlayerService::decode(int fd, int64_t offset, int64_t length,
    if (cache->wait() != NO_ERROR) goto Exit;

    ALOGV("start");
    player->start();
    if (player->start() != NO_ERROR) goto Exit;

    ALOGV("wait for playback complete");
    cache->wait();
@@ -2094,6 +2094,7 @@ status_t MediaPlayerService::AudioCache::open(
{
    ALOGV("open(%u, %d, 0x%x, %d, %d)", sampleRate, channelCount, channelMask, format, bufferCount);
    if (mHeap->getHeapID() < 0) {
        ALOGE("Invalid heap Id");
        return NO_INIT;
    }