From 78c670e69cea1cc8c6874dc058c19b2a90f8df3e Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Tue, 25 Jun 2019 10:50:35 -0700 Subject: [PATCH] Speed up SimpleDecodingSource SimpleDecodingSource was waiting up to 5 milliseconds for each input buffer, when it should not have been waiting at all, and instead just check if there's an output buffer. This greatly increases throughput for files with small buffers such as audio files, e.g. a 6x speedup was observed for ogg and mp3 test streams. Test: stagefright Change-Id: If9fc91b823442926e8452d0e6cf95735b7248596 --- media/libstagefright/SimpleDecodingSource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/libstagefright/SimpleDecodingSource.cpp b/media/libstagefright/SimpleDecodingSource.cpp index babdc7a669..8b6262fa71 100644 --- a/media/libstagefright/SimpleDecodingSource.cpp +++ b/media/libstagefright/SimpleDecodingSource.cpp @@ -36,7 +36,7 @@ using namespace android; const int64_t kTimeoutWaitForOutputUs = 500000; // 0.5 seconds -const int64_t kTimeoutWaitForInputUs = 5000; // 5 milliseconds +const int64_t kTimeoutWaitForInputUs = 0; // don't wait const int kTimeoutMaxRetries = 20; //static