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

Commit b93e3893 authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am cfe45c77: Merge change I96c4d4b3 into eclair

Merge commit 'cfe45c775ddb5e48bf556aee7422298260eb4fd8' into eclair-plus-aosp

* commit 'cfe45c775ddb5e48bf556aee7422298260eb4fd8':
  Fix for random audio output failures, properly dup() the file descriptor in IMediaPlayer::setDataSource to assume ownership as the caller will otherwise close it.
parents 8abf5aa1 a75e9fb4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -40,11 +40,13 @@ status_t StagefrightPlayer::setDataSource(const char *url) {
    return err;
}

// Warning: The filedescriptor passed into this method will only be valid until
// the method returns, if you want to keep it, dup it!
status_t StagefrightPlayer::setDataSource(int fd, int64_t offset, int64_t length) {
    LOGV("setDataSource(%d, %lld, %lld)", fd, offset, length);

    reset();
    mPlayer = new MediaPlayerImpl(fd, offset, length);
    mPlayer = new MediaPlayerImpl(dup(fd), offset, length);

    status_t err = mPlayer->initCheck();
    if (err != OK) {