diff options
Diffstat (limited to 'src/riff.c')
-rw-r--r-- | src/riff.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -20,8 +20,8 @@ static int header_write(xas_riff *riff) { .riff = { { .id = "RIFF", - .size = sizeof(xas_riff_wave_chunk) - + sizeof(xas_riff_chunk) + .size = sizeof(xas_riff_main_chunk) + + sizeof(xas_riff_wave_chunk) + riff->size }, @@ -89,7 +89,7 @@ static xas_riff *file_open(const char *path, goto error_open; } - riff->size = 0; + riff->size = 0; riff->sample_size = sample_size; riff->sample_rate = sample_rate; riff->channels = channels; @@ -141,6 +141,8 @@ static int audio_drain(xas_riff *riff, goto error_write; } + riff->size += wrlen; + return wrlen / stream->sample_size / stream->channels; error_write: |