changeset 17219:fde45c312c31

calculate framesize for raw RGB and BGR.
author reimar
date Sun, 18 Dec 2005 11:57:25 +0000
parents cffd0ec5d01a
children a27e52b838e3
files libmpdemux/demux_rawvideo.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_rawvideo.c	Sun Dec 18 11:55:47 2005 +0000
+++ b/libmpdemux/demux_rawvideo.c	Sun Dec 18 11:57:25 2005 +0000
@@ -81,8 +81,14 @@
   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);