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

Commit 9f6e4f06 authored by Preetam Singh Ranawat's avatar Preetam Singh Ranawat Committed by Linux Build Service Account
Browse files

libstagefright: Fix to handle EAGAIN error on first read to source

 -Some of AV streaming clips are not played
 -In streaming use case when source does not have sufficent data it
  return error EAGAIN on first read request, player ignore this error
  and treat it as a first buffer.
 -Make the read request again to source on EAGAIN error.

Change-Id: I3feaccce757c17c4e80e6d62375c3d700ca29e72
parent ca46843e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -102,7 +102,10 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) {
        mSeeking = false;
    }

    do {
        mFirstBufferResult = mSource->read(&mFirstBuffer, &options);
    } while (mFirstBufferResult == -EAGAIN);

    if (mFirstBufferResult == INFO_FORMAT_CHANGED) {
        ALOGV("INFO_FORMAT_CHANGED!!!");