aboutsummaryrefslogtreecommitdiff
path: root/www/chromium
diff options
context:
space:
mode:
authorCarlos J. Puga Medina <cpm@FreeBSD.org>2019-07-28 18:05:33 +0000
committerCarlos J. Puga Medina <cpm@FreeBSD.org>2019-07-28 18:05:33 +0000
commit8018602ab564f779fcd874f6db462fb2a5bda7e5 (patch)
treecbcf7bc0900ab978e54ac21d7d83df7d830536cb /www/chromium
parent4be7c8cc4a1fc27ac1663193356876bd3b7afc92 (diff)
downloadports-8018602ab564f779fcd874f6db462fb2a5bda7e5.tar.gz
ports-8018602ab564f779fcd874f6db462fb2a5bda7e5.zip
Notes
Diffstat (limited to 'www/chromium')
-rw-r--r--www/chromium/files/sndio_input.cc2
-rw-r--r--www/chromium/files/sndio_output.cc9
2 files changed, 6 insertions, 5 deletions
diff --git a/www/chromium/files/sndio_input.cc b/www/chromium/files/sndio_input.cc
index c4214a5f84ba..6c7bc8b8025b 100644
--- a/www/chromium/files/sndio_input.cc
+++ b/www/chromium/files/sndio_input.cc
@@ -188,7 +188,7 @@ void SndioAudioInputStream::ThreadLoop(void) {
// convert frames count to TimeDelta
const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay,
- params.sample_rate() * 1000);
+ params.sample_rate());
// push into bus
audio_bus->FromInterleaved(buffer, nframes, SampleFormatToBytesPerChannel(kSampleFormat));
diff --git a/www/chromium/files/sndio_output.cc b/www/chromium/files/sndio_output.cc
index 72f9741dadc3..d806113e6216 100644
--- a/www/chromium/files/sndio_output.cc
+++ b/www/chromium/files/sndio_output.cc
@@ -140,7 +140,7 @@ void SndioAudioOutputStream::GetVolume(double* v) {
}
void SndioAudioOutputStream::ThreadLoop(void) {
- int avail, count;
+ int avail, count, result;
while (state == kRunning) {
// Update volume if needed
@@ -152,7 +152,8 @@ void SndioAudioOutputStream::ThreadLoop(void) {
pthread_mutex_unlock(&mutex);
// Get data to play
- const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay, params.sample_rate() * 1000);
+ const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay,
+ params.sample_rate());
count = source->OnMoreData(delay, base::TimeTicks::Now(), 0, audio_bus.get());
audio_bus->ToInterleaved(count, SampleFormatToBytesPerChannel(kSampleFormat), buffer);
if (count == 0) {
@@ -164,8 +165,8 @@ void SndioAudioOutputStream::ThreadLoop(void) {
// Submit data to the device
avail = count * params.GetBytesPerFrame(kSampleFormat);
- count = sio_write(hdl, buffer, avail);
- if (count == 0) {
+ result = sio_write(hdl, buffer, avail);
+ if (result == 0) {
LOG(WARNING) << "Audio device disconnected.";
break;
}