FreeBSD Bugzilla – Attachment 250886 Details for
Bug 279180
www/qt6-webengine: fails to build with SNDIO=on (sndio_output.cc:14:27: error: redefinition of 'kSampleFormat')
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed fix for qt6-webengine + SNDIO
qt6-webengine-sndio-fix.diff (text/plain), 4.38 KB, created by
Jason E. Hale
on 2024-05-23 01:02:34 UTC
(
hide
)
Description:
Proposed fix for qt6-webengine + SNDIO
Filename:
MIME Type:
Creator:
Jason E. Hale
Created:
2024-05-23 01:02:34 UTC
Size:
4.38 KB
patch
obsolete
>diff --git a/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__input.cc b/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__input.cc >index aebbac4f7a18..f6da297f1cb2 100644 >--- a/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__input.cc >+++ b/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__input.cc >@@ -13,7 +13,7 @@ > + > +namespace media { > + >-+static const SampleFormat kSampleFormat = kSampleFormatS16; >++static const SampleFormat kSampleFormatAI = kSampleFormatS16; > + > +void SndioAudioInputStream::OnMoveCallback(void *arg, int delta) > +{ >@@ -59,7 +59,7 @@ > + sio_initpar(&par); > + par.rate = params.sample_rate(); > + par.rchan = params.channels(); >-+ par.bits = SampleFormatToBitsPerChannel(kSampleFormat); >++ par.bits = SampleFormatToBitsPerChannel(kSampleFormatAI); > + par.bps = par.bits / 8; > + par.sig = sig = par.bits != 8 ? 1 : 0; > + par.le = SIO_LE_NATIVE; >@@ -79,7 +79,7 @@ > + > + if (par.rate != (unsigned int)params.sample_rate() || > + par.rchan != (unsigned int)params.channels() || >-+ par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) || >++ par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormatAI) || > + par.sig != (unsigned int)sig || > + (par.bps > 1 && par.le != SIO_LE_NATIVE) || > + (par.bits != par.bps * 8)) { >@@ -87,7 +87,7 @@ > + goto bad_close; > + } > + state = kStopped; >-+ buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)]; >++ buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormatAI)]; > + sio_onmove(hdl, &OnMoveCallback, this); > + return OpenOutcome::kSuccess; > +bad_close: >@@ -176,7 +176,7 @@ > + GetAgcVolume(&normalized_volume); > + > + // read one block >-+ todo = nframes * params.GetBytesPerFrame(kSampleFormat); >++ todo = nframes * params.GetBytesPerFrame(kSampleFormatAI); > + data = buffer; > + while (todo > 0) { > + n = sio_read(hdl, data, todo); >diff --git a/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__output.cc b/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__output.cc >index 5ee661707307..363cb11cbb93 100644 >--- a/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__output.cc >+++ b/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__output.cc >@@ -14,7 +14,7 @@ > + > +namespace media { > + >-+static const SampleFormat kSampleFormat = kSampleFormatS16; >++static const SampleFormat kSampleFormatAO = kSampleFormatS16; > + > +void SndioAudioOutputStream::OnMoveCallback(void *arg, int delta) { > + SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg); >@@ -58,7 +58,7 @@ > + state = kStopped; > + volpending = 0; > + vol = SIO_MAXVOL; >-+ buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)]; >++ buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormatAO)]; > + return true; > +} > + >@@ -80,7 +80,7 @@ > + sio_initpar(&par); > + par.rate = params.sample_rate(); > + par.pchan = params.channels(); >-+ par.bits = SampleFormatToBitsPerChannel(kSampleFormat); >++ par.bits = SampleFormatToBitsPerChannel(kSampleFormatAO); > + par.bps = par.bits / 8; > + par.sig = sig = par.bits != 8 ? 1 : 0; > + par.le = SIO_LE_NATIVE; >@@ -98,7 +98,7 @@ > + } > + if (par.rate != (unsigned int)params.sample_rate() || > + par.pchan != (unsigned int)params.channels() || >-+ par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) || >++ par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormatAO) || > + par.sig != (unsigned int)sig || > + (par.bps > 1 && par.le != SIO_LE_NATIVE) || > + (par.bits != par.bps * 8)) { >@@ -170,12 +170,12 @@ > + if (count == 0) { > + // We have to submit something to the device > + count = audio_bus->frames(); >-+ memset(buffer, 0, count * params.GetBytesPerFrame(kSampleFormat)); >++ memset(buffer, 0, count * params.GetBytesPerFrame(kSampleFormatAO)); > + LOG(WARNING) << "No data to play, running empty cycle."; > + } > + > + // Submit data to the device >-+ avail = count * params.GetBytesPerFrame(kSampleFormat); >++ avail = count * params.GetBytesPerFrame(kSampleFormatAO); > + result = sio_write(hdl, buffer, avail); > + if (result == 0) { > + LOG(WARNING) << "Audio device disconnected.";
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 279180
: 250886