int riff_ds64(wav_reader_t *reader, int64_t *length)
{
    uint32_t fcc, chunk_size, table_size;
    uint64_t riff_size, sample_count;

    fcc = riff_next_chunk(reader, &chunk_size);
    ENSURE(fcc == RIFF_FOURCC('d','s','6','4') && chunk_size >= 28);
    TRY_IO(pcm_scanl(&reader->io, "QQQL",
                     &riff_size, length, &sample_count, &table_size) != 4);
    TRY_IO(pcm_skip(&reader->io, (chunk_size - 27) & ~1));
FAIL:
    return -1;
}
int riff_ds64(wav_reader_t *reader, int64_t *length)
{
    uint32_t fcc, chunk_size, table_size;
    uint64_t riff_size, sample_count;

    fcc = riff_next_chunk(reader, &chunk_size);
    ENSURE(fcc == RIFF_FOURCC('d','s','6','4') && chunk_size >= 28);
    TRY_IO(pcm_scanl(&reader->io, "QQQL",
                     &riff_size, length, &sample_count, &table_size) != 4);
    TRY_IO(pcm_skip(&reader->io, (chunk_size - 27) & ~1));
FAIL:
    return -1;
}