projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vss: Add documentation of MAP_POPULATE.
[paraslash.git]
/
check_wav.c
diff --git
a/check_wav.c
b/check_wav.c
index a36cea9ab34fb319bf7070eaa43e8bb65dcfcd24..89ebdacc0805e9575acea92d09ed3b2dd81ebac3 100644
(file)
--- a/
check_wav.c
+++ b/
check_wav.c
@@
-1,8
+1,4
@@
-/*
- * Copyright (C) 2005-2014 Andre Noll <maan@systemlinux.org>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2005 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
/** \file check_wav.c Detect and delete a wav header. */
/** \file check_wav.c Detect and delete a wav header. */
@@
-15,6
+11,7
@@
#include "buffer_tree.h"
#include "error.h"
#include "check_wav.h"
#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
/** Length of a standard wav header. */
#define WAV_HEADER_LEN 44
@@
-159,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. */
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);
if (bps != 8 && bps != 16) {
PARA_WARNING_LOG("%u bps not supported, assuming 16\n",
bps);
@@
-177,7
+174,7
@@
int check_wav_post_select(struct check_wav_context *cwc)
else
cwc->sample_format = (a[3] == 'F')?
SF_S16_LE : SF_S16_BE;
else
cwc->sample_format = (a[3] == 'F')?
SF_S16_LE : SF_S16_BE;
- PARA_NOTICE_LOG("%
d
Hz, %s, %s\n", cwc->sample_rate,
+ PARA_NOTICE_LOG("%
u
Hz, %s, %s\n", cwc->sample_rate,
cwc->channels == 1? "mono" : "stereo",
sample_formats[cwc->sample_format]);
btr_consume(btrn, WAV_HEADER_LEN);
cwc->channels == 1? "mono" : "stereo",
sample_formats[cwc->sample_format]);
btr_consume(btrn, WAV_HEADER_LEN);