summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-18 20:52:06 +0200
committerwm4 <wm4@nowhere>2017-08-18 20:52:06 +0200
commit463f4e2fd2f87f3960b3d1af70441eb4cb83f69f (patch)
tree3c805e3896625b642f03eb387357b42bb9695a98
parentfc5ad325a76d317a203e4e5d3ed311c09049cd20 (diff)
downloadmpv-spherical-metadata.tar.bz2
mpv-spherical-metadata.tar.xz
-rw-r--r--video/filter/vf_format.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c
index 406180ba34..581bbe332f 100644
--- a/video/filter/vf_format.c
+++ b/video/filter/vf_format.c
@@ -19,6 +19,7 @@
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
+#include <math.h>
#include <libavutil/rational.h>
@@ -47,7 +48,7 @@ struct vf_priv_s {
int dw, dh;
double dar;
int spherical;
- int spherical_ref_angles[3];
+ float spherical_ref_angles[3];
};
static bool is_compatible(int fmt1, int fmt2)
@@ -132,7 +133,7 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in,
if (p->spherical)
out->spherical.type = p->spherical;
for (int n = 0; n < 3; n++) {
- if (p->spherical_ref_angles[n] != -1000)
+ if (isfinite(p->spherical_ref_angles[n]))
out->spherical.ref_angles[n] = p->spherical_ref_angles[n];
}
@@ -175,9 +176,9 @@ static const m_option_t vf_opts_fields[] = {
OPT_INT("dh", dh, 0),
OPT_DOUBLE("dar", dar, 0),
OPT_CHOICE_C("spherical", spherical, 0, mp_spherical_names),
- OPT_INT("spherical-yaw", spherical_ref_angles[0], 0),
- OPT_INT("spherical-pitch", spherical_ref_angles[1], 0),
- OPT_INT("spherical-roll", spherical_ref_angles[1], 0),
+ OPT_FLOAT("spherical-yaw", spherical_ref_angles[0], 0),
+ OPT_FLOAT("spherical-pitch", spherical_ref_angles[1], 0),
+ OPT_FLOAT("spherical-roll", spherical_ref_angles[2], 0),
OPT_REMOVED("outputlevels", "use the --video-output-levels global option"),
OPT_REMOVED("peak", "use sig-peak instead (changed value scale!)"),
{0}
@@ -191,6 +192,6 @@ const vf_info_t vf_info_format = {
.options = vf_opts_fields,
.priv_defaults = &(const struct vf_priv_s){
.rotate = -1,
- .spherical_ref_angles = {-1000, -1000, -1000},
+ .spherical_ref_angles = {NAN, NAN, NAN},
},
};