allow other simulation types, e.g. ac

prevents crash
This commit is contained in:
Holger Vogt 2024-08-03 11:39:22 +02:00
parent 81a664128a
commit d0dbc71280
1 changed files with 8 additions and 1 deletions

View File

@ -469,6 +469,9 @@ com_sndprint(wordlist* wl)
ngood += 1;
}
if (vecs->v_plot->pl_scale->v_type != SV_TIME)
return;
if (!ngood) return;
snd_init(ngood);
@ -482,7 +485,11 @@ com_sndprint(wordlist* wl)
double samplerate = snd_get_samplerate();
while ((j < npoints)) {
double tme = bv->v_plot->pl_scale->v_realdata[j] * samplerate;
double tme;
if (isreal(bv->v_plot->pl_scale))
tme = bv->v_plot->pl_scale->v_realdata[j] * samplerate;
else
tme = realpart(bv->v_plot->pl_scale->v_compdata[j]) * samplerate;
int c = 0;
for (v = bv; v; v = v->v_link2) {
if (v->v_length <= j) {