X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=check_wav.c;h=89ebdacc0805e9575acea92d09ed3b2dd81ebac3;hp=f0990bf8fcde6b99388f46319402c00bb5c1143c;hb=23ef2355fbdebce56083ec7a0ebb65a05c42e5dc;hpb=e5de57de1b8bf1df96c152fc92f5a49f75d6d96c diff --git a/check_wav.c b/check_wav.c index f0990bf8..89ebdacc 100644 --- a/check_wav.c +++ b/check_wav.c @@ -11,6 +11,7 @@ #include "buffer_tree.h" #include "error.h" #include "check_wav.h" +#include "portable_io.h" /** Length of a standard wav header. */ #define WAV_HEADER_LEN 44 @@ -155,9 +156,9 @@ int check_wav_post_select(struct check_wav_context *cwc) PARA_INFO_LOG("found wav header\n"); cwc->state = CWS_HAVE_HEADER; /* Only set those values which have not already been set. */ - cwc->channels = (unsigned)a[22]; - cwc->sample_rate = a[24] + (a[25] << 8) + (a[26] << 16) + (a[27] << 24); - bps = a[34] + ((unsigned)a[35] << 8); + cwc->channels = a[22]; + cwc->sample_rate = read_u32(a + 24); + bps = read_u16(a + 34); if (bps != 8 && bps != 16) { PARA_WARNING_LOG("%u bps not supported, assuming 16\n", bps);