changeset 5373:b476f5d1c91e

10l to nick - ACCEPT_WIDTH fixed
author arpi
date Wed, 27 Mar 2002 21:49:19 +0000
parents ee9dd55ef383
children 774189ab0446
files libvo/vosub_vidix.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vosub_vidix.c	Wed Mar 27 21:27:38 2002 +0000
+++ b/libvo/vosub_vidix.c	Wed Mar 27 21:49:19 2002 +0000
@@ -636,18 +636,28 @@
     if((is_422_planes_eq || (mpi->flags&(MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH)) && 
        !forced_fourcc && !(vidix_play.flags & VID_PLAY_INTERLEAVED_UV)))
     {
+	if(mpi->flags&MP_IMGFLAG_ACCEPT_WIDTH){
+	    // check if only width is enough to represent strides:
+	    if(mpi->flags&MP_IMGFLAG_PLANAR){
+		if((dstrides.y>>1)!=dstrides.v || dstrides.v!=dstrides.u) return VO_FALSE;
+	    } else {
+		if(dstrides.y % (mpi->bpp/8)) return VO_FALSE;
+	    }
+	}
 	mpi->planes[0]=vidix_mem+vidix_play.offsets[next_frame]+vidix_play.offset.y;
-	mpi->stride[0]=dstrides.y;
+	mpi->width=mpi->stride[0]=dstrides.y;
 	if(mpi->flags&MP_IMGFLAG_PLANAR)
 	{
 	    mpi->planes[2]=vidix_mem+vidix_play.offsets[next_frame]+vidix_play.offset.v;
 	    mpi->stride[2]=dstrides.v;
 	    mpi->planes[1]=vidix_mem+vidix_play.offsets[next_frame]+vidix_play.offset.u;
 	    mpi->stride[1]=dstrides.u;
-	}
+	} else
+	    mpi->width/=mpi->bpp/8;
 	mpi->flags|=MP_IMGFLAG_DIRECT;
+	return VO_TRUE;
     }
-    return VO_TRUE;
+    return VO_FALSE;
 }
 
 uint32_t vidix_control(uint32_t request, void *data, ...)