mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
avfilter/avf_showspectrum: fix hz scale with legend enabled
This commit is contained in:
parent
014ace8f98
commit
e5c860cd29
@ -759,7 +759,7 @@ static int draw_legend(AVFilterContext *ctx, int samples)
|
||||
for (y = 0; y < h; y += 40) {
|
||||
float range = s->stop ? s->stop - s->start : inlink->sample_rate / 2;
|
||||
float bin = s->fscale == F_LINEAR ? y : get_log_hz(y, h, inlink->sample_rate);
|
||||
float hertz = s->start + bin * range / (float)(1 << (int)ceil(log2(h)));
|
||||
float hertz = s->start + bin * range / (float)h;
|
||||
char *units;
|
||||
|
||||
if (hertz == 0)
|
||||
@ -817,7 +817,7 @@ static int draw_legend(AVFilterContext *ctx, int samples)
|
||||
for (x = 0; x < w - 79; x += 80) {
|
||||
float range = s->stop ? s->stop - s->start : inlink->sample_rate / 2;
|
||||
float bin = s->fscale == F_LINEAR ? x : get_log_hz(x, w, inlink->sample_rate);
|
||||
float hertz = s->start + bin * range / (float)(1 << (int)ceil(log2(w)));
|
||||
float hertz = s->start + bin * range / (float)w;
|
||||
char *units;
|
||||
|
||||
if (hertz == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user