Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jul 2019 18:05:33 +0000 (UTC)
From:      "Carlos J. Puga Medina" <cpm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r507520 - head/www/chromium/files
Message-ID:  <201907281805.x6SI5XEf052086@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cpm
Date: Sun Jul 28 18:05:33 2019
New Revision: 507520
URL: https://svnweb.freebsd.org/changeset/ports/507520

Log:
  www/chromium: Fix audio/video synchronization bug after r506266
  
  PR:		238869
  Submitted by:	tobik
  Reported by:	jrm
  MFH:		2019Q3

Modified:
  head/www/chromium/files/sndio_input.cc
  head/www/chromium/files/sndio_output.cc

Modified: head/www/chromium/files/sndio_input.cc
==============================================================================
--- head/www/chromium/files/sndio_input.cc	Sun Jul 28 18:05:25 2019	(r507519)
+++ head/www/chromium/files/sndio_input.cc	Sun Jul 28 18:05:33 2019	(r507520)
@@ -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));

Modified: head/www/chromium/files/sndio_output.cc
==============================================================================
--- head/www/chromium/files/sndio_output.cc	Sun Jul 28 18:05:25 2019	(r507519)
+++ head/www/chromium/files/sndio_output.cc	Sun Jul 28 18:05:33 2019	(r507520)
@@ -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;
     }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907281805.x6SI5XEf052086>