]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/transform.c
* include/video_output.h, ALL: changed api for vout_Request()/vout_Create() to be...
[vlc] / modules / video_filter / transform.c
index be4ede3d1e593df79e159f13b25cab9aea8730ce..954b96b2dd559788d3bd838516475c366c4d90e2 100644 (file)
@@ -180,6 +180,7 @@ static int Init( vout_thread_t *p_vout )
 {
     int i_index;
     picture_t *p_pic;
+    video_format_t fmt = {0};
 
     I_OUTPUTPICTURES = 0;
 
@@ -189,23 +190,31 @@ static int Init( vout_thread_t *p_vout )
     p_vout->output.i_height = p_vout->render.i_height;
     p_vout->output.i_aspect = p_vout->render.i_aspect;
 
+    fmt.i_width = fmt.i_visible_width = p_vout->render.i_width;
+    fmt.i_height = fmt.i_visible_height = p_vout->render.i_height;
+    fmt.i_x_offset = fmt.i_y_offset = 0;
+    fmt.i_chroma = p_vout->render.i_chroma;
+    fmt.i_aspect = p_vout->render.i_aspect;
+    fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width;
+    fmt.i_sar_den = VOUT_ASPECT_FACTOR;
+
     /* Try to open the real video output */
     msg_Dbg( p_vout, "spawning the real video output" );
 
     if( p_vout->p_sys->b_rotation )
     {
-        p_vout->p_sys->p_vout = vout_Create( p_vout,
-                           p_vout->render.i_height, p_vout->render.i_width,
-                           p_vout->render.i_chroma,
-                           (uint64_t)VOUT_ASPECT_FACTOR
-                            * (uint64_t)VOUT_ASPECT_FACTOR
-                            / (uint64_t)p_vout->render.i_aspect );
+        fmt.i_width = fmt.i_visible_width = p_vout->render.i_height;
+        fmt.i_height = fmt.i_visible_height = p_vout->render.i_width;
+        fmt.i_aspect = VOUT_ASPECT_FACTOR *
+            (uint64_t)VOUT_ASPECT_FACTOR / p_vout->render.i_aspect;
+        fmt.i_sar_num = VOUT_ASPECT_FACTOR;
+        fmt.i_sar_den = p_vout->render.i_aspect * fmt.i_height / fmt.i_width;
+
+        p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt );
     }
     else
     {
-        p_vout->p_sys->p_vout = vout_Create( p_vout,
-                           p_vout->render.i_width, p_vout->render.i_height,
-                           p_vout->render.i_chroma, p_vout->render.i_aspect );
+        p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt );
     }
 
     /* Everything failed */