diff options
-rw-r--r-- | media/libstagefright/AudioPlayer.cpp | 13 |
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; } |