[vlc-commits] commit: Fixed raw picture size in rawvideo codec. (Laurent Aimar )

git at videolan.org git at videolan.org
Mon May 24 23:59:56 CEST 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon May 24 19:51:51 2010 +0200| [932f2030e756d2e942890492766a10e65f4faeab] | committer: Laurent Aimar 

Fixed raw picture size in rawvideo codec.

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

 modules/codec/rawvideo.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c
index fd71d99..dbb8fde 100644
--- a/modules/codec/rawvideo.c
+++ b/modules/codec/rawvideo.c
@@ -165,8 +165,14 @@ static int OpenDecoder( vlc_object_t *p_this )
                         p_dec->fmt_in.video.i_height,
                         p_dec->fmt_in.video.i_sar_num,
                         p_dec->fmt_in.video.i_sar_den );
-    p_sys->i_raw_size = p_dec->fmt_out.video.i_bits_per_pixel *
-        p_dec->fmt_out.video.i_width * p_dec->fmt_out.video.i_height / 8;
+    picture_t picture;
+    picture_Setup( &picture, p_dec->fmt_out.i_codec,
+                   p_dec->fmt_in.video.i_width,
+                   p_dec->fmt_in.video.i_height, 0, 1 );
+    p_sys->i_raw_size = 0;
+    for( int i = 0; i < picture.i_planes; i++ )
+        p_sys->i_raw_size += picture.p[i].i_visible_pitch *
+                             picture.p[i].i_visible_lines;
 
     if( !p_dec->fmt_in.video.i_sar_num || !p_dec->fmt_in.video.i_sar_den )
     {



More information about the vlc-commits mailing list