lib/cdio: use std::span instead of ConstBuffer

This commit is contained in:
Max Kellermann 2022-07-04 18:30:15 +02:00
parent b9c9a5f1dd
commit 8fa212f04d
2 changed files with 3 additions and 4 deletions

View File

@ -298,7 +298,7 @@ CdioParanoiaInputStream::Read(std::unique_lock<Mutex> &,
const ScopeUnlock unlock(mutex);
try {
rbuf = para.Read().data;
rbuf = para.Read().data();
} catch (...) {
char *s_err = cdio_cddap_errors(drv);
if (s_err) {

View File

@ -30,11 +30,10 @@
#ifndef CDIO_PARANOIA_HXX
#define CDIO_PARANOIA_HXX
#include "util/ConstBuffer.hxx"
#include <cdio/version.h>
#include <cdio/paranoia/paranoia.h>
#include <span>
#include <stdexcept>
#include <utility>
@ -149,7 +148,7 @@ public:
throw std::runtime_error("Failed to seek disc");
}
ConstBuffer<int16_t> Read() {
std::span<const int16_t> Read() {
const int16_t *data = cdio_paranoia_read(paranoia, nullptr);
if (data == nullptr)
throw std::runtime_error("Read from audio CD failed");