summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/AudioPlayer.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-05-16 19:06:19 -0700
committerJames Dong <jdong@google.com>2012-05-17 12:07:25 -0700
commit022048e95f3f1d65cb776cf21de2001423fcf7d9 (patch)
tree0edc08faec3a504a9ff456520338ff63e1a08551 /media/libstagefright/AudioPlayer.cpp
parent88ba895b5ddd8b3da364c3ceacdb698224ee746f (diff)
downloadframeworks_av-022048e95f3f1d65cb776cf21de2001423fcf7d9.zip
frameworks_av-022048e95f3f1d65cb776cf21de2001423fcf7d9.tar.gz
frameworks_av-022048e95f3f1d65cb776cf21de2001423fcf7d9.tar.bz2
Stop audio source if AudioPlayer could not be started
related-to-bug: 6500580 Change-Id: If47e442db2f1ea400e9b598502bb48513f28cd6d
Diffstat (limited to 'media/libstagefright/AudioPlayer.cpp')
-rw-r--r--media/libstagefright/AudioPlayer.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/media/libstagefright/AudioPlayer.cpp b/media/libstagefright/AudioPlayer.cpp
index 4208019..6b1be1f 100644
--- a/media/libstagefright/AudioPlayer.cpp
+++ b/media/libstagefright/AudioPlayer.cpp
@@ -142,9 +142,10 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) {
mFirstBuffer = NULL;
}
- if (!sourceAlreadyStarted) {
- mSource->stop();
- }
+ // At this point, source already got started
+ // Stop the source when error is found.
+ mSource->stop();
+ mSource = NULL;
return err;
}
@@ -174,9 +175,9 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) {
mFirstBuffer = NULL;
}
- if (!sourceAlreadyStarted) {
- mSource->stop();
- }
+ // At this point, source already got started
+ // Stop the source when error is found.
+ mSource->stop();
return err;
}