make sure sample length is never 0

This commit is contained in:
Bill Currie 2004-04-29 03:00:25 +00:00
parent c456eb1f80
commit c99a011f21

View file

@ -272,16 +272,16 @@ get_info (QFile *file)
info.rate = dfmt->samples_per_sec;
info.width = dfmt->bits_per_sample / 8;
info.channels = dfmt->channels;
info.samples = 0;
if (cp) {
info.loopstart = cp->sample_offset;
if (dltxt)
info.samples = info.loopstart + dltxt->len;
else
info.samples = data->ck.len / (info.width * info.channels);
} else {
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.datalen = data->ck.len;