[FFmpeg-cvslog] avfilter/vf_v360: make reset_rot option not lose its value

Paul B Mahol git at videolan.org
Wed Oct 20 15:50:09 EEST 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Oct 20 14:40:30 2021 +0200| [960efa94ff817d3c0761ce7414ddd632cfe7ed74] | committer: Paul B Mahol

avfilter/vf_v360: make reset_rot option not lose its value

Unless -1 value is provided then rotation is reset single time.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=960efa94ff817d3c0761ce7414ddd632cfe7ed74
---

 libavfilter/vf_v360.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index ed25e1f07d..c252a2057a 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -164,7 +164,7 @@ static const AVOption v360_options[] = {
     {    "iv_fov", "input vertical field of view",  OFFSET(iv_fov), AV_OPT_TYPE_FLOAT,  {.dbl=0.f},           0.f,               360.f,TFLAGS, "iv_fov"},
     {    "id_fov", "input diagonal field of view",  OFFSET(id_fov), AV_OPT_TYPE_FLOAT,  {.dbl=0.f},           0.f,               360.f,TFLAGS, "id_fov"},
     {"alpha_mask", "build mask in alpha plane",      OFFSET(alpha), AV_OPT_TYPE_BOOL,   {.i64=0},               0,                   1, FLAGS, "alpha"},
-    { "reset_rot", "reset rotation",             OFFSET(reset_rot), AV_OPT_TYPE_BOOL,   {.i64=0},               0,                   1,TFLAGS, "reset_rot"},
+    { "reset_rot", "reset rotation",             OFFSET(reset_rot), AV_OPT_TYPE_BOOL,   {.i64=0},              -1,                   1,TFLAGS, "reset_rot"},
     { NULL }
 };
 
@@ -4962,7 +4962,8 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
     int ret;
 
     s->yaw = s->pitch = s->roll = 0.f;
-    s->reset_rot = 0;
+    if (s->reset_rot < 0)
+        s->reset_rot = 0;
 
     ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
     if (ret < 0)



More information about the ffmpeg-cvslog mailing list