video_output: fix viewpoint initialization from input
authorThomas Guillem <thomas@gllm.fr>
Thu, 17 Nov 2016 08:22:54 +0000 (09:22 +0100)
committerThomas Guillem <thomas@gllm.fr>
Thu, 17 Nov 2016 08:35:54 +0000 (09:35 +0100)
Partially revert commits 8a62e7a2e14d8715e9783c895661a3901a2b96bf
and 2d32661b145718b2d31dbf9a2f23b7f7af39799c

src/video_output/video_output.c

index 6c937c0..fde5947 100644 (file)
@@ -559,8 +559,13 @@ static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, cons
     if (p_viewpoint != NULL)
         cfg->viewpoint = *p_viewpoint;
     else
-        vlc_viewpoint_init( &cfg->viewpoint );
-
+    {
+        cfg->viewpoint.yaw = vout->p->original.f_pose_yaw_degrees;
+        cfg->viewpoint.pitch = vout->p->original.f_pose_pitch_degrees;
+        cfg->viewpoint.roll = vout->p->original.f_pose_roll_degrees;
+        cfg->viewpoint.fov = vout->p->original.f_pose_fov_degrees;
+        cfg->viewpoint.zoom = 0.f;
+    }
     cfg->display.title = title;
     const int display_width = var_CreateGetInteger(vout, "width");
     const int display_height = var_CreateGetInteger(vout, "height");
@@ -1471,16 +1476,6 @@ static int ThreadReinit(vout_thread_t *vout,
         state.cfg.zoom.den = 1;
     }
 
-    if (original.projection_mode == PROJECTION_MODE_EQUIRECTANGULAR
-        || original.projection_mode == PROJECTION_MODE_CUBEMAP_LAYOUT_STANDARD)
-    {
-        state.cfg.viewpoint.yaw = original.f_pose_yaw_degrees;
-        state.cfg.viewpoint.pitch = original.f_pose_pitch_degrees;
-        state.cfg.viewpoint.roll = original.f_pose_roll_degrees;
-        state.cfg.viewpoint.fov = original.f_pose_fov_degrees;
-        state.cfg.viewpoint.zoom = 0.f;
-    }
-
     vout->p->original = original;
     vout->p->dpb_size = cfg->dpb_size;
     if (ThreadStart(vout, &state)) {