[vlc-commits] macosx vout: really fix crop this time

David Fuhrmann git at videolan.org
Fri Apr 20 13:40:19 CEST 2012


vlc/vlc-2.0 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Fri Apr 20 12:26:02 2012 +0200| [7c02dbf8a99ed5d828257f6c1c1f850d01bbada3] | committer: Felix Paul Kühne

macosx vout: really fix crop this time

...hopefully.
This avoids distorted images, and also preserves a correct ar, even on crop 1:1.

refs #6080
(cherry picked from commit 4a1c818c067a5481f06bcbcf0d7a5d7b56db1a8b)

Conflicts:

	modules/video_output/macosx.m

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=7c02dbf8a99ed5d828257f6c1c1f850d01bbada3
---

 modules/video_output/macosx.m |   36 +-----------------------------------
 1 files changed, 1 insertions(+), 35 deletions(-)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 7b7c93a..1047b11 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -296,7 +296,7 @@ static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *sub
 {
     vout_display_sys_t *sys = vd->sys;
     [sys->glView setVoutFlushing:YES];
-    vout_display_opengl_Display(sys->vgl, &vd->fmt );
+    vout_display_opengl_Display(sys->vgl, &vd->source );
     [sys->glView setVoutFlushing:NO];
     picture_Release (pic);
     sys->has_first_frame = true;
@@ -404,36 +404,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
 
             vout_display_PlacePicture (&place, source, &cfg_tmp, false);
 
-                vd->fmt.i_width  = vd->source.i_width  * place.width  / vd->source.i_visible_width;
-                vd->fmt.i_height = vd->source.i_height * place.height / vd->source.i_visible_height;
-                vd->fmt.i_visible_width  = vd->source.i_visible_width;
-                vd->fmt.i_visible_height = vd->source.i_visible_height;
-                vd->fmt.i_x_offset = vd->source.i_x_offset * place.width  / vd->source.i_visible_width;
-                vd->fmt.i_y_offset = vd->source.i_y_offset * place.height / vd->source.i_visible_height;
-
-                i_width = place.width;
-                i_height = place.height;
-
-                if (vd->fmt.i_x_offset > 0)
-                {
-                    if (vd->source.i_width / vd->fmt.i_x_offset <= 4)
-                    {
-                        /* hack and special case for the "Default" state
-                         * The 'Default' state tries to set the dimensions with a huge x offset and a weird
-                         * width / height ratio, which definitely isn't the default for the played media. 
-                         * That's why, we enforce the media's actual dimensions here.
-                         * The quotient of 4 is a stochastic value, which isn't reached by any other crop state. */
-                        vd->fmt.i_width  = vd->source.i_width;
-                        vd->fmt.i_height = vd->source.i_height;
-                        vd->fmt.i_visible_width  = vd->source.i_width;
-                        vd->fmt.i_visible_height = vd->source.i_height;
-                        vd->fmt.i_x_offset = 0;
-                        vd->fmt.i_y_offset = 0;
-                        i_width = vd->source.i_width;
-                        i_height = vd->source.i_height;
-                    }
-                }
-
             /* For resize, we call glViewport in reshape and not here.
                This has the positive side effect that we avoid erratic sizing as we animate every resize. */
             if (query != VOUT_DISPLAY_CHANGE_DISPLAY_SIZE)
@@ -441,10 +411,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
                 glViewport (place.x, place.y, place.width, place.height);
             }
 
-            // this should not be needed, but currently it improves crop somehow, when we are in fullscreen
-            if (query == VOUT_DISPLAY_CHANGE_SOURCE_CROP)
-                [sys->glView performSelectorOnMainThread:@selector(reshapeView:) withObject:nil waitUntilDone:NO];
-
             [o_pool release];
             return VLC_SUCCESS;
         }



More information about the vlc-commits mailing list