summaryrefslogtreecommitdiffstats
path: root/src/riff.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/riff.c')
-rw-r--r--src/riff.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/riff.c b/src/riff.c
index 3a4933f..cae821e 100644
--- a/src/riff.c
+++ b/src/riff.c
@@ -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: