Merge "After failing to create an AudioTrack, only stop the source if we were the ones starting it." into kraken
This commit is contained in:
committed by
Android (Google) Code Review
commit
2cb138dbe8
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user