From 932f2030e756d2e942890492766a10e65f4faeab Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Mon, 24 May 2010 19:51:51 +0200 Subject: [PATCH] Fixed raw picture size in rawvideo codec. --- modules/codec/rawvideo.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c index fd71d99dd5..dbb8fdeae6 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 ) { -- 2.39.2