[vlc-commits] commit: Fixed support for crop parameters in picture_NewFrom*(). ( Laurent Aimar )

git at videolan.org git at videolan.org
Sun Nov 7 16:45:28 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Nov  7 14:40:57 2010 +0100| [045ec346a34c025d368e6820a1e566f7fdf79a04] | committer: Laurent Aimar 

Fixed support for crop parameters in picture_NewFrom*().

They were previously lost.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=045ec346a34c025d368e6820a1e566f7fdf79a04
---

 src/misc/picture.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/misc/picture.c b/src/misc/picture.c
index d13a0d1..b738446 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -196,6 +196,11 @@ picture_t *picture_NewFromResource( const video_format_t *p_fmt, const picture_r
     video_format_Setup( &fmt, p_fmt->i_chroma,
                               p_fmt->i_width, p_fmt->i_height,
                               p_fmt->i_sar_num, p_fmt->i_sar_den );
+    if( p_fmt->i_x_offset < p_fmt->i_width &&
+        p_fmt->i_y_offset < p_fmt->i_height &&
+        p_fmt->i_visible_width  > 0 && p_fmt->i_x_offset + p_fmt->i_visible_width  <= p_fmt->i_width &&
+        p_fmt->i_visible_height > 0 && p_fmt->i_y_offset + p_fmt->i_visible_height <= p_fmt->i_height )
+        video_format_CopyCrop( &fmt, p_fmt );
 
     /* */
     picture_t *p_picture = calloc( 1, sizeof(*p_picture) );



More information about the vlc-commits mailing list