Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: content/browser/renderer_host/media/audio_sync_reader.cc

Issue 2760243002: Set audio_sync_reader timeout as half buffer duration on ChromeOS (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/audio_sync_reader.h" 5 #include "content/browser/renderer_host/media/audio_sync_reader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 std::unique_ptr<base::CancelableSyncSocket> foreign_socket) 51 std::unique_ptr<base::CancelableSyncSocket> foreign_socket)
52 : shared_memory_(std::move(shared_memory)), 52 : shared_memory_(std::move(shared_memory)),
53 mute_audio_(base::CommandLine::ForCurrentProcess()->HasSwitch( 53 mute_audio_(base::CommandLine::ForCurrentProcess()->HasSwitch(
54 switches::kMuteAudio)), 54 switches::kMuteAudio)),
55 socket_(std::move(socket)), 55 socket_(std::move(socket)),
56 foreign_socket_(std::move(foreign_socket)), 56 foreign_socket_(std::move(foreign_socket)),
57 packet_size_(shared_memory_->requested_size()), 57 packet_size_(shared_memory_->requested_size()),
58 renderer_callback_count_(0), 58 renderer_callback_count_(0),
59 renderer_missed_callback_count_(0), 59 renderer_missed_callback_count_(0),
60 trailing_renderer_missed_callback_count_(0), 60 trailing_renderer_missed_callback_count_(0),
61 #if defined(OS_MACOSX) 61 #if defined(OS_MACOSX) || defined(OS_CHROMEOS)
62 maximum_wait_time_(params.GetBufferDuration() / 2), 62 maximum_wait_time_(params.GetBufferDuration() / 2),
63 #else 63 #else
64 // TODO(dalecurtis): Investigate if we can reduce this on all platforms. 64 // TODO(dalecurtis): Investigate if we can reduce this on all platforms.
65 maximum_wait_time_(base::TimeDelta::FromMilliseconds(20)), 65 maximum_wait_time_(base::TimeDelta::FromMilliseconds(20)),
66 #endif 66 #endif
67 buffer_index_(0) { 67 buffer_index_(0) {
68 DCHECK_EQ(static_cast<size_t>(packet_size_), 68 DCHECK_EQ(static_cast<size_t>(packet_size_),
69 sizeof(media::AudioOutputBufferParameters) + 69 sizeof(media::AudioOutputBufferParameters) +
70 AudioBus::CalculateMemorySize(params)); 70 AudioBus::CalculateMemorySize(params));
71 AudioOutputBuffer* buffer = 71 AudioOutputBuffer* buffer =
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 base::TimeDelta::FromMilliseconds(1), 254 base::TimeDelta::FromMilliseconds(1),
255 base::TimeDelta::FromMilliseconds(1000), 255 base::TimeDelta::FromMilliseconds(1000),
256 50); 256 50);
257 return false; 257 return false;
258 } 258 }
259 259
260 return true; 260 return true;
261 } 261 }
262 262
263 } // namespace content 263 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698