1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-03 11:12:13 +00:00

www/chromium: Fix audio/video synchronization bug after r506266

PR:		238869
Submitted by:	tobik
Reported by:	jrm
MFH:		2019Q3
This commit is contained in:
Carlos J. Puga Medina 2019-07-28 18:05:33 +00:00
parent 4be7c8cc4a
commit 8018602ab5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=507520
2 changed files with 6 additions and 5 deletions

View File

@ -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));

View File

@ -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;
}