Other part of size is calculated from both available horizontal and vertical FOV and given one size component.
Unified · Split
| @@ -3790,7 +3790,15 @@ static int config_output(AVFilterLink *outlink) · 3789 unmodified lines | ||
| 3790 | 3790 | } |
| 3791 | 3791 | |
| 3792 | 3792 | // Override resolution with user values if specified |
| 3793 | − if (s->width > 0 && s->height > 0) { | |
| 3793 | + if (s->width > 0 && s->height <= 0 && s->h_fov > 0.f && s->v_fov > 0.f && | |
| 3794 | + s->out == FLAT && s->d_fov == 0.f) { | |
| 3795 | + w = s->width; | |
| 3796 | + h = w / tanf(s->h_fov * M_PI / 360.f) * tanf(s->v_fov * M_PI / 360.f); | |
| 3797 | + } else if (s->width <= 0 && s->height > 0 && s->h_fov > 0.f && s->v_fov > 0.f && | |
| 3798 | + s->out == FLAT && s->d_fov == 0.f) { | |
| 3799 | + h = s->height; | |
| 3800 | + w = h / tanf(s->v_fov * M_PI / 360.f) * tanf(s->h_fov * M_PI / 360.f); | |
| 3801 | + } else if (s->width > 0 && s->height > 0) { | |
| 3794 | 3802 | w = s->width; |
| 3795 | 3803 | h = s->height; |
| 3796 | 3804 | } else if (s->width > 0 || s->height > 0) { |