diff options
| author | 2010-05-26 13:10:15 -0700 | |
|---|---|---|
| committer | 2010-05-26 13:10:15 -0700 | |
| commit | 5fb03b876b6749c17d7ee6f41f62c4e5e7d6367e (patch) | |
| tree | 89caf9d9432278a2d020ec203a737fbf76f55f5b | |
| parent | a581a7764041e1444da42a287abef88fd1db5b66 (diff) | |
After failing to create an AudioTrack, only stop the source if we were the ones starting it.
Change-Id: I1820c2634cfeb01af9eaf11b6473c5d7b87d1fa3
related-to-bug: 2716035
| -rw-r--r-- | media/libstagefright/AudioPlayer.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/media/libstagefright/AudioPlayer.cpp b/media/libstagefright/AudioPlayer.cpp index bcf246397266..b79ba13a9ba3 100644 --- a/media/libstagefright/AudioPlayer.cpp +++ b/media/libstagefright/AudioPlayer.cpp @@ -87,7 +87,9 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) { DEFAULT_AUDIOSINK_BUFFERCOUNT, &AudioPlayer::AudioSinkCallback, this); if (err != OK) { - mSource->stop(); + if (!sourceAlreadyStarted) { + mSource->stop(); + } return err; } @@ -108,7 +110,9 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) { delete mAudioTrack; mAudioTrack = NULL; - mSource->stop(); + if (!sourceAlreadyStarted) { + mSource->stop(); + } return err; } |