diff options
author | tobik <tobik@FreeBSD.org> | 2019-08-13 01:43:35 +0800 |
---|---|---|
committer | tobik <tobik@FreeBSD.org> | 2019-08-13 01:43:35 +0800 |
commit | cd0e6d4eefbbbde8932cb2259fbebe9452f2f356 (patch) | |
tree | 118673d335fe74b8ee84007404b7dd46458d4742 | |
parent | 6d41d4b8f72952b5cac42fbd5386d2b94d458c4c (diff) | |
download | freebsd-ports-gnome-cd0e6d4eefbbbde8932cb2259fbebe9452f2f356.tar.gz freebsd-ports-gnome-cd0e6d4eefbbbde8932cb2259fbebe9452f2f356.tar.zst freebsd-ports-gnome-cd0e6d4eefbbbde8932cb2259fbebe9452f2f356.zip |
www/chromium: Sync sndio backend with OpenBSD and unbreak build after r508722
../../media/audio/openbsd/audio_manager_openbsd.cc:158:14: error: allocating an object of abstract class type 'media::SndioAudioOutputStream'
return new SndioAudioOutputStream(params, this);
^
../../media/audio/audio_io.h:117:16: note: unimplemented pure virtual method 'Flush' in 'SndioAudioOutputStream'
virtual void Flush() = 0;
PR: 239802
Submitted by: tobik
Reported by: kib
Tested by: kib
Approved by: chromium (cpm)
MFH: 2019Q3 (together with r508722)
-rw-r--r-- | www/chromium/files/sndio_output.cc | 8 | ||||
-rw-r--r-- | www/chromium/files/sndio_output.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/www/chromium/files/sndio_output.cc b/www/chromium/files/sndio_output.cc index d806113e6216..fd299a845bfc 100644 --- a/www/chromium/files/sndio_output.cc +++ b/www/chromium/files/sndio_output.cc @@ -58,7 +58,7 @@ bool SndioAudioOutputStream::Open() { sio_initpar(&par); par.rate = params.sample_rate(); par.pchan = params.channels(); - par.bits = SampleFormatToBitsPerChannel(kSampleFormat); + par.bits = SampleFormatToBitsPerChannel(kSampleFormat); par.bps = par.bits / 8; par.sig = sig = par.bits != 8 ? 1 : 0; par.le = SIO_LE_NATIVE; @@ -139,6 +139,10 @@ void SndioAudioOutputStream::GetVolume(double* v) { pthread_mutex_unlock(&mutex); } +// This stream is always used with sub second buffer sizes, where it's +// sufficient to simply always flush upon Start(). +void SndioAudioOutputStream::Flush() {} + void SndioAudioOutputStream::ThreadLoop(void) { int avail, count, result; @@ -153,7 +157,7 @@ void SndioAudioOutputStream::ThreadLoop(void) { // Get data to play const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay, - params.sample_rate()); + params.sample_rate()); count = source->OnMoreData(delay, base::TimeTicks::Now(), 0, audio_bus.get()); audio_bus->ToInterleaved(count, SampleFormatToBytesPerChannel(kSampleFormat), buffer); if (count == 0) { diff --git a/www/chromium/files/sndio_output.h b/www/chromium/files/sndio_output.h index eef460ef65b5..ead220ca96e7 100644 --- a/www/chromium/files/sndio_output.h +++ b/www/chromium/files/sndio_output.h @@ -31,6 +31,7 @@ class SndioAudioOutputStream : public AudioOutputStream { void Stop() override; void SetVolume(double volume) override; void GetVolume(double* volume) override; + void Flush() override; friend void sndio_onmove(void *arg, int delta); friend void sndio_onvol(void *arg, unsigned int vol); |