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

Side by Side Diff: media/midi/midi_manager_alsa.cc

Issue 864943002: Replaces instances of the deprecated TimeTicks::HighResNow() with TimeTicks::Now(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More changes based on review comments. Created 5 years, 11 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 | « media/base/yuv_convert_perftest.cc ('k') | media/midi/usb_midi_device_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/midi/midi_manager_alsa.h" 5 #include "media/midi/midi_manager_alsa.h"
6 6
7 #include <alsa/asoundlib.h> 7 #include <alsa/asoundlib.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 void MidiManagerAlsa::EventReset() { 385 void MidiManagerAlsa::EventReset() {
386 event_thread_.message_loop()->PostTask( 386 event_thread_.message_loop()->PostTask(
387 FROM_HERE, 387 FROM_HERE,
388 base::Bind(&MidiManagerAlsa::EventLoop, base::Unretained(this))); 388 base::Bind(&MidiManagerAlsa::EventLoop, base::Unretained(this)));
389 } 389 }
390 390
391 void MidiManagerAlsa::EventLoop() { 391 void MidiManagerAlsa::EventLoop() {
392 // Read available incoming MIDI data. 392 // Read available incoming MIDI data.
393 snd_seq_event_t* event; 393 snd_seq_event_t* event;
394 int err = snd_seq_event_input(in_client_, &event); 394 int err = snd_seq_event_input(in_client_, &event);
395 double timestamp = 395 double timestamp = (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF();
396 (base::TimeTicks::HighResNow() - base::TimeTicks()).InSecondsF();
397 if (err == -ENOSPC) { 396 if (err == -ENOSPC) {
398 VLOG(1) << "snd_seq_event_input detected buffer overrun"; 397 VLOG(1) << "snd_seq_event_input detected buffer overrun";
399 398
400 // We've lost events: check another way to see if we need to shut down. 399 // We've lost events: check another way to see if we need to shut down.
401 base::AutoLock lock(shutdown_lock_); 400 base::AutoLock lock(shutdown_lock_);
402 if (event_thread_shutdown_) { 401 if (event_thread_shutdown_) {
403 return; 402 return;
404 } 403 }
405 } else if (err < 0) { 404 } else if (err < 0) {
406 VLOG(1) << "snd_seq_event_input fails: " << snd_strerror(err); 405 VLOG(1) << "snd_seq_event_input fails: " << snd_strerror(err);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 event_thread_.message_loop()->PostTask( 443 event_thread_.message_loop()->PostTask(
445 FROM_HERE, 444 FROM_HERE,
446 base::Bind(&MidiManagerAlsa::EventLoop, base::Unretained(this))); 445 base::Bind(&MidiManagerAlsa::EventLoop, base::Unretained(this)));
447 } 446 }
448 447
449 MidiManager* MidiManager::Create() { 448 MidiManager* MidiManager::Create() {
450 return new MidiManagerAlsa(); 449 return new MidiManagerAlsa();
451 } 450 }
452 451
453 } // namespace media 452 } // namespace media
OLDNEW
« no previous file with comments | « media/base/yuv_convert_perftest.cc ('k') | media/midi/usb_midi_device_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698