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)
This commit is contained in:
parent
906923baf5
commit
44439e7c1d
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=508754
2 changed files with 7 additions and 2 deletions
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue