From b9fa4f0876d145cdbd679a053e93a152b83cd145 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sat, 5 Jun 2010 16:54:20 +0000 Subject: Take into account wav ``riff'' header when calculating the offset of the data chuck returned in ``startpos''. Fixes MMC relocate being off by few samples. --- usr.bin/aucat/headers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/aucat') diff --git a/usr.bin/aucat/headers.c b/usr.bin/aucat/headers.c index a1a361a68ee..37594e2afc2 100644 --- a/usr.bin/aucat/headers.c +++ b/usr.bin/aucat/headers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: headers.c,v 1.17 2010/06/05 16:52:28 ratchov Exp $ */ +/* $OpenBSD: headers.c,v 1.18 2010/06/05 16:54:19 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -201,7 +201,7 @@ wav_readhdr(int fd, struct aparams *par, off_t *startpos, off_t *datasz, short * return 0; fmt_done = 1; } else if (memcmp(chunk.id, wav_id_data, 4) == 0) { - *startpos = pos; + *startpos = pos + sizeof(riff) + sizeof(chunk); *datasz = csize; break; } else { -- cgit v1.2.3