From 3d88ee3a9316adfdcd923fb399037f63b1e9fb13 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Thu, 26 Jan 2017 16:36:43 -0500 Subject: Increased frequency of OnAudioPassThru notifications to once every 50ms It was requested that during AudioPassThru, notifications should be sent on a more frequent basis to allow for better real-time processing of the data. This value is not changed from 1 second when EXTENDED_MEDIA_MODE is disabled, as the AudioPassThru data is faked in this case. --- .../media_manager/src/audio/audio_stream_sender_thread.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc index 24b12cabad..7c18cb400b 100644 --- a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc +++ b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc @@ -52,7 +52,11 @@ namespace media_manager { using sync_primitives::AutoLock; -const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 1; +#ifdef EXTENDED_MEDIA_MODE +const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 50; +#else +const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 1000; +#endif const uint32_t kMqueueMessageSize = 4095; CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager") @@ -79,7 +83,7 @@ void AudioStreamSenderThread::threadMain() { while (false == getShouldBeStopped()) { AutoLock auto_lock(shouldBeStoped_lock_); - shouldBeStoped_cv_.WaitFor(auto_lock, kAudioPassThruTimeout * 1000); + shouldBeStoped_cv_.WaitFor(auto_lock, kAudioPassThruTimeout); sendAudioChunkToMobile(); } } -- cgit v1.2.1