summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_vidix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_out/video_out_vidix.c')
-rw-r--r--src/video_out/video_out_vidix.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c
index 9f7ff09cd..92e29bd7c 100644
--- a/src/video_out/video_out_vidix.c
+++ b/src/video_out/video_out_vidix.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_vidix.c,v 1.6 2002/07/12 20:36:04 f1rmb Exp $
+ * $Id: video_out_vidix.c,v 1.7 2002/07/15 21:42:34 esnel Exp $
*
* video_out_vidix.c
*
@@ -558,7 +558,6 @@ static void vidix_update_frame_format (vo_driver_t *this_gen,
int ratio_code, int format, int flags) {
vidix_frame_t *frame = (vidix_frame_t *) frame_gen;
- uint32_t frame_size = width*height;
if ((frame->width != width)
|| (frame->height != height)
@@ -576,12 +575,16 @@ static void vidix_update_frame_format (vo_driver_t *this_gen,
switch(format) {
case IMGFMT_YV12:
- frame->vo_frame.base[0] = malloc(frame_size);
- frame->vo_frame.base[1] = malloc(frame_size/4);
- frame->vo_frame.base[2] = malloc(frame_size/4);
+ frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
+ frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
+ frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
+ frame->vo_frame.base[0] = malloc(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = malloc(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = malloc(frame->vo_frame.pitches[2] * ((height+1)/2));
break;
case IMGFMT_YUY2:
- frame->vo_frame.base[0] = malloc(frame_size*2);
+ frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
+ frame->vo_frame.base[0] = malloc(frame->vo_frame.pitches[0] * height);
frame->vo_frame.base[1] = NULL;
frame->vo_frame.base[2] = NULL;
break;