diff options
author | Artem Nosach <ANosach@luxoft.com> | 2015-03-16 16:21:10 +0200 |
---|---|---|
committer | Artem Nosach <ANosach@luxoft.com> | 2015-04-23 15:32:08 +0300 |
commit | 86a857e50d80dd10adac946e4a3be8cc33f7416d (patch) | |
tree | 6a38a42acd96c918956719f6d2a0b2f748c99ee6 | |
parent | 7c5a65c5b84af881beefbeb66b70983122ef8f11 (diff) | |
download | smartdevicelink-86a857e50d80dd10adac946e4a3be8cc33f7416d.tar.gz |
Do not recreate audio/video retry timer.
-rw-r--r-- | src/components/application_manager/src/application_impl.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index bfb732741..673e0a42d 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -375,10 +375,12 @@ void ApplicationImpl::set_hmi_supports_navi_video_streaming(bool supports) { profile::Profile::instance()->start_stream_retry_amount(); set_video_stream_retry_active(true); video_stream_retry_number_ = stream_retry.first; - video_stream_retry_timer_ = - utils::SharedPtr<timer::TimerThread<ApplicationImpl>>( - new timer::TimerThread<ApplicationImpl>( - "VideoStreamRetry", this, &ApplicationImpl::OnVideoStreamRetry, true)); + if (!video_stream_retry_timer_.valid()){ + video_stream_retry_timer_ = + utils::SharedPtr<timer::TimerThread<ApplicationImpl>>( + new timer::TimerThread<ApplicationImpl>( + "VideoStreamRetry", this, &ApplicationImpl::OnVideoStreamRetry, true)); + } // start separate pthread for timer without delays video_stream_retry_timer_->start(0); } @@ -400,10 +402,12 @@ void ApplicationImpl::set_hmi_supports_navi_audio_streaming(bool supports) { profile::Profile::instance()->start_stream_retry_amount(); set_audio_stream_retry_active(true); audio_stream_retry_number_ = stream_retry.first; - audio_stream_retry_timer_ = - utils::SharedPtr<timer::TimerThread<ApplicationImpl>>( - new timer::TimerThread<ApplicationImpl>( - "AudioStreamRetry", this, &ApplicationImpl::OnAudioStreamRetry, true)); + if (!audio_stream_retry_timer_.valid()){ + audio_stream_retry_timer_ = + utils::SharedPtr<timer::TimerThread<ApplicationImpl>>( + new timer::TimerThread<ApplicationImpl>( + "AudioStreamRetry", this, &ApplicationImpl::OnAudioStreamRetry, true)); + } // start separate pthread for timer without delays audio_stream_retry_timer_->start(0); } |