Merge "After failing to create an AudioTrack, only stop the source if we were the ones starting it." into kraken
diff --git a/media/libstagefright/AudioPlayer.cpp b/media/libstagefright/AudioPlayer.cpp
index bcf2463..b79ba13 100644
--- a/media/libstagefright/AudioPlayer.cpp
+++ b/media/libstagefright/AudioPlayer.cpp
@@ -87,7 +87,9 @@
DEFAULT_AUDIOSINK_BUFFERCOUNT,
&AudioPlayer::AudioSinkCallback, this);
if (err != OK) {
- mSource->stop();
+ if (!sourceAlreadyStarted) {
+ mSource->stop();
+ }
return err;
}
@@ -108,7 +110,9 @@
delete mAudioTrack;
mAudioTrack = NULL;
- mSource->stop();
+ if (!sourceAlreadyStarted) {
+ mSource->stop();
+ }
return err;
}