Loading media/codec2/fuzzer/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,12 @@ cc_defaults { "-Wall", "-Werror", ], fuzz_config: { cc: [ "wonsik@google.com", ], }, } cc_fuzz { Loading media/libaaudio/src/client/AudioStreamInternalPlay.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -202,10 +202,18 @@ aaudio_result_t AudioStreamInternalPlay::processDataNow(void *buffer, int32_t nu break; case AAUDIO_STREAM_STATE_STARTED: { // Sleep until the readCounter catches up and we only have // the getBufferSize() frames of data sitting in the buffer. int64_t nextReadPosition = mAudioEndpoint->getDataWriteCounter() - getBufferSize(); wakeTime = mClockModel.convertPositionToTime(nextReadPosition); // Calculate when there will be room available to write to the buffer. // If the appBufferSize is smaller than the endpointBufferSize then // we will have room to write data beyond the appBufferSize. // That is a technique used to reduce glitches without adding latency. const int32_t appBufferSize = getBufferSize(); // The endpoint buffer size is set to the maximum that can be written. // If we use it then we must carve out some room to write data when we wake up. const int32_t endBufferSize = mAudioEndpoint->getBufferSizeInFrames() - getFramesPerBurst(); const int32_t bestBufferSize = std::min(appBufferSize, endBufferSize); int64_t targetReadPosition = mAudioEndpoint->getDataWriteCounter() - bestBufferSize; wakeTime = mClockModel.convertPositionToTime(targetReadPosition); } break; default: Loading media/libaaudio/src/utility/AAudioUtilities.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -562,7 +562,9 @@ int32_t AAudioProperty_getWakeupDelayMicros() { int32_t AAudioProperty_getMinimumSleepMicros() { const int32_t minMicros = 1; // arbitrary // Higher values can increase latency for moderate workloads. const int32_t defaultMicros = 1; // arbitrary // Short values can cause the CPU to short cycle if there is a bug in // calculating the wakeup times. const int32_t defaultMicros = 100; // arbitrary const int32_t maxMicros = 200; // arbitrary int32_t prop = property_get_int32(AAUDIO_PROP_MINIMUM_SLEEP_USEC, defaultMicros); if (prop < minMicros) { Loading media/libmediahelper/Android.bp +5 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,10 @@ cc_library { "-Wextra", "-Wall", ], shared_libs: ["libutils", "liblog"], shared_libs: [ "libutils", "liblog", ], header_libs: [ "libmedia_helper_headers", "libaudio_system_headers", Loading @@ -52,7 +55,7 @@ cc_library { export_header_lib_headers: [ "libmedia_helper_headers", ], clang: true, host_supported: true, target: { darwin: { Loading media/libstagefright/foundation/Android.bp +1 −6 Original line number Diff line number Diff line Loading @@ -120,8 +120,6 @@ cc_defaults { }, }, clang: true, sanitize: { misc_undefined: [ "unsigned-integer-overflow", Loading Loading @@ -200,8 +198,6 @@ cc_library_static { "ColorUtils_fill.cpp", ], clang: true, sanitize: { misc_undefined: [ "unsigned-integer-overflow", Loading @@ -218,4 +214,3 @@ cc_library_static { ], } Loading
media/codec2/fuzzer/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,12 @@ cc_defaults { "-Wall", "-Werror", ], fuzz_config: { cc: [ "wonsik@google.com", ], }, } cc_fuzz { Loading
media/libaaudio/src/client/AudioStreamInternalPlay.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -202,10 +202,18 @@ aaudio_result_t AudioStreamInternalPlay::processDataNow(void *buffer, int32_t nu break; case AAUDIO_STREAM_STATE_STARTED: { // Sleep until the readCounter catches up and we only have // the getBufferSize() frames of data sitting in the buffer. int64_t nextReadPosition = mAudioEndpoint->getDataWriteCounter() - getBufferSize(); wakeTime = mClockModel.convertPositionToTime(nextReadPosition); // Calculate when there will be room available to write to the buffer. // If the appBufferSize is smaller than the endpointBufferSize then // we will have room to write data beyond the appBufferSize. // That is a technique used to reduce glitches without adding latency. const int32_t appBufferSize = getBufferSize(); // The endpoint buffer size is set to the maximum that can be written. // If we use it then we must carve out some room to write data when we wake up. const int32_t endBufferSize = mAudioEndpoint->getBufferSizeInFrames() - getFramesPerBurst(); const int32_t bestBufferSize = std::min(appBufferSize, endBufferSize); int64_t targetReadPosition = mAudioEndpoint->getDataWriteCounter() - bestBufferSize; wakeTime = mClockModel.convertPositionToTime(targetReadPosition); } break; default: Loading
media/libaaudio/src/utility/AAudioUtilities.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -562,7 +562,9 @@ int32_t AAudioProperty_getWakeupDelayMicros() { int32_t AAudioProperty_getMinimumSleepMicros() { const int32_t minMicros = 1; // arbitrary // Higher values can increase latency for moderate workloads. const int32_t defaultMicros = 1; // arbitrary // Short values can cause the CPU to short cycle if there is a bug in // calculating the wakeup times. const int32_t defaultMicros = 100; // arbitrary const int32_t maxMicros = 200; // arbitrary int32_t prop = property_get_int32(AAUDIO_PROP_MINIMUM_SLEEP_USEC, defaultMicros); if (prop < minMicros) { Loading
media/libmediahelper/Android.bp +5 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,10 @@ cc_library { "-Wextra", "-Wall", ], shared_libs: ["libutils", "liblog"], shared_libs: [ "libutils", "liblog", ], header_libs: [ "libmedia_helper_headers", "libaudio_system_headers", Loading @@ -52,7 +55,7 @@ cc_library { export_header_lib_headers: [ "libmedia_helper_headers", ], clang: true, host_supported: true, target: { darwin: { Loading
media/libstagefright/foundation/Android.bp +1 −6 Original line number Diff line number Diff line Loading @@ -120,8 +120,6 @@ cc_defaults { }, }, clang: true, sanitize: { misc_undefined: [ "unsigned-integer-overflow", Loading Loading @@ -200,8 +198,6 @@ cc_library_static { "ColorUtils_fill.cpp", ], clang: true, sanitize: { misc_undefined: [ "unsigned-integer-overflow", Loading @@ -218,4 +214,3 @@ cc_library_static { ], }