io/FileDescriptor: add Read()/Write() overloads with std::span
This commit is contained in:
committed by
Max Kellermann
parent
5fbe5951ab
commit
cad35a83fb
@@ -671,7 +671,7 @@ OssOutput::Play(std::span<const std::byte> src)
|
||||
return src.size();
|
||||
|
||||
while (true) {
|
||||
const ssize_t ret = fd.Write(e.data(), e.size());
|
||||
const ssize_t ret = fd.Write(e);
|
||||
if (ret > 0)
|
||||
return pcm_export->CalcInputSize(ret);
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ SolarisOutput::Close() noexcept
|
||||
std::size_t
|
||||
SolarisOutput::Play(std::span<const std::byte> src)
|
||||
{
|
||||
ssize_t nbytes = fd.Write(src.data(), src.size());
|
||||
ssize_t nbytes = fd.Write(src);
|
||||
if (nbytes <= 0)
|
||||
throw MakeErrno("Write failed");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user