Skip to content

Commit

Permalink
libstagefright: Fix to handle EAGAIN error on first read to source
Browse files Browse the repository at this point in the history
 -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
  • Loading branch information
Preetam Singh Ranawat authored and anerikg committed Jun 2, 2014
1 parent eb20f90 commit 900b0b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion media/libstagefright/AudioPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) {
mSeeking = false;
}

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

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

Expand Down

0 comments on commit 900b0b7

Please sign in to comment.