decoder/Client: pass std::span to SubmitData()

This commit is contained in:
Max Kellermann
2022-07-11 18:03:06 +02:00
parent 329c448d30
commit c34f6ed8c0
30 changed files with 138 additions and 116 deletions

View File

@@ -419,15 +419,16 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
#ifdef HAVE_SIDPLAYFP
/* libsidplayfp returns the number of samples */
const size_t nbytes = result * sizeof(buffer[0]);
const size_t n_samples = result;
#else
/* libsidplay2 returns the number of bytes */
const size_t nbytes = result;
const size_t n_samples = result / sizeof(buffer[0]);
#endif
client.SubmitTimestamp(FloatDuration(player.time()) / timebase);
cmd = client.SubmitData(nullptr, buffer, nbytes, 0);
cmd = client.SubmitAudio(nullptr, std::span{buffer, n_samples},
0);
if (cmd == DecoderCommand::SEEK) {
unsigned data_time = player.time();