libstagefright: remove out of date profiling result before doing a new profiling.
Bug: 21333717
Change-Id: Iaeff615fccf87b3aceed6fa566f82c06a981e030
diff --git a/media/libstagefright/MediaCodecList.cpp b/media/libstagefright/MediaCodecList.cpp
index d48ede9..3f10be6 100644
--- a/media/libstagefright/MediaCodecList.cpp
+++ b/media/libstagefright/MediaCodecList.cpp
@@ -79,6 +79,8 @@
// static
void *MediaCodecList::profilerThreadWrapper(void * /*arg*/) {
ALOGV("Enter profilerThreadWrapper.");
+ remove(kProfilingResults); // remove previous result so that it won't be loaded to
+ // the new MediaCodecList
MediaCodecList *codecList = new MediaCodecList();
if (codecList->initCheck() != OK) {
ALOGW("Failed to create a new MediaCodecList, skipping codec profiling.");