Fixed timelimit use

This commit is contained in:
Abramo Bagnara 2000-07-12 16:25:21 +00:00
parent c88189e490
commit 54164096e3

View file

@ -733,6 +733,7 @@ static int test_wavefile(void *buffer, size_t size)
} }
} }
if (LE_INT(c->length) < count)
count = LE_INT(c->length); count = LE_INT(c->length);
check_new_format(&format); check_new_format(&format);
return (char *)c + sizeof(*c) - (char *) buffer; return (char *)c + sizeof(*c) - (char *) buffer;
@ -1614,6 +1615,7 @@ static void playback(char *name)
{ {
int fd, ofs; int fd, ofs;
count = calc_count();
snd_pcm_flush(handle); snd_pcm_flush(handle);
if (!name || !strcmp(name, "-")) { if (!name || !strcmp(name, "-")) {
fd = 0; fd = 0;
@ -1658,7 +1660,6 @@ static void playback(char *name)
/* should be raw data */ /* should be raw data */
check_new_format(&rformat); check_new_format(&rformat);
init_raw_data(); init_raw_data();
count = calc_count();
playback_go(fd, 64, count, FORMAT_RAW, name); playback_go(fd, 64, count, FORMAT_RAW, name);
} }
__end: __end:
@ -1681,7 +1682,8 @@ static void capture(char *name)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
count = calc_count() & 0xFFFFFFFE; count = calc_count();
count += count % 2;
/* WAVE-file should be even (I'm not sure), but wasting one byte /* WAVE-file should be even (I'm not sure), but wasting one byte
isn't a problem (this can only be in 8 bit mono) */ isn't a problem (this can only be in 8 bit mono) */
if (fmt_rec_table[file_type].start) if (fmt_rec_table[file_type].start)