aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-18 11:57:25 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-18 11:57:25 +0000
commit06ed3c2b57c5088d3b35af67f047d5ed3192d72c (patch)
tree4639b7395154d998c3bb24babe7b32994a5466cb /libmpdemux
parentf8c0e0cf04e768bac5fb1f3f4dbbd3a7a6c205fc (diff)
calculate framesize for raw RGB and BGR.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17220 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_rawvideo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libmpdemux/demux_rawvideo.c b/libmpdemux/demux_rawvideo.c
index b6cec47ef1..4e0f42caec 100644
--- a/libmpdemux/demux_rawvideo.c
+++ b/libmpdemux/demux_rawvideo.c
@@ -81,8 +81,14 @@ static demuxer_t* demux_rawvideo_open(demuxer_t* demuxer) {
case IMGFMT_UYVY: imgsize=width*height*2;break;
case IMGFMT_Y8: imgsize=width*height;break;
default:
+ if (IMGFMT_IS_RGB(format))
+ imgsize = width * height * ((IMGFMT_RGB_DEPTH(format) + 7) >> 3);
+ else if (IMGFMT_IS_BGR(format))
+ imgsize = width * height * ((IMGFMT_BGR_DEPTH(format) + 7) >> 3);
+ else {
mp_msg(MSGT_DEMUX,MSGL_ERR,"rawvideo: img size not specified and unknown format!\n");
return 0;
+ }
}
sh_video = new_sh_video(demuxer,0);