Revert "Stop audio source if AudioPlayer could not be started"
This reverts commit 022048e95f3f1d65cb776cf21de2001423fcf7d9.
diff --git a/media/libstagefright/AudioPlayer.cpp b/media/libstagefright/AudioPlayer.cpp
index 6b1be1f..4208019 100644
--- a/media/libstagefright/AudioPlayer.cpp
+++ b/media/libstagefright/AudioPlayer.cpp
@@ -142,10 +142,9 @@
mFirstBuffer = NULL;
}
- // At this point, source already got started
- // Stop the source when error is found.
- mSource->stop();
- mSource = NULL;
+ if (!sourceAlreadyStarted) {
+ mSource->stop();
+ }
return err;
}
@@ -175,9 +174,9 @@
mFirstBuffer = NULL;
}
- // At this point, source already got started
- // Stop the source when error is found.
- mSource->stop();
+ if (!sourceAlreadyStarted) {
+ mSource->stop();
+ }
return err;
}