mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
make sure sample length is never 0
This commit is contained in:
parent
c456eb1f80
commit
c99a011f21
1 changed files with 3 additions and 3 deletions
|
@ -272,16 +272,16 @@ get_info (QFile *file)
|
||||||
info.rate = dfmt->samples_per_sec;
|
info.rate = dfmt->samples_per_sec;
|
||||||
info.width = dfmt->bits_per_sample / 8;
|
info.width = dfmt->bits_per_sample / 8;
|
||||||
info.channels = dfmt->channels;
|
info.channels = dfmt->channels;
|
||||||
|
info.samples = 0;
|
||||||
if (cp) {
|
if (cp) {
|
||||||
info.loopstart = cp->sample_offset;
|
info.loopstart = cp->sample_offset;
|
||||||
if (dltxt)
|
if (dltxt)
|
||||||
info.samples = info.loopstart + dltxt->len;
|
info.samples = info.loopstart + dltxt->len;
|
||||||
else
|
|
||||||
info.samples = data->ck.len / (info.width * info.channels);
|
|
||||||
} else {
|
} else {
|
||||||
info.loopstart = -1;
|
info.loopstart = -1;
|
||||||
info.samples = data->ck.len / (info.width * info.channels);
|
|
||||||
}
|
}
|
||||||
|
if (!info.samples)
|
||||||
|
info.samples = data->ck.len / (info.width * info.channels);
|
||||||
info.dataofs = *(int *)data->data;
|
info.dataofs = *(int *)data->data;
|
||||||
info.datalen = data->ck.len;
|
info.datalen = data->ck.len;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue