[MPlayer-dev-eng] [PATCH] Fix packed YUV in dshow vo

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Oct 6 19:53:41 CEST 2008


On Mon, Oct 06, 2008 at 10:30:36AM -0400, Laurent wrote:
> Index: libvo/vo_directx.c
> ===================================================================
> --- libvo/vo_directx.c	(revision 27514)
> +++ libvo/vo_directx.c	(working copy)
> @@ -37,6 +37,8 @@
>  #include "aspect.h"
>  #include "geometry.h"
>  #include "mp_fifo.h"
> +// For FFMIN
> +#include "libavutil/common.h"
>  
>  #ifdef CONFIG_GUI
>  #include "gui/interface.h"
> @@ -1276,7 +1278,17 @@
>  	}
>  	else //packed
>  	{
> -        fast_memcpy( image, mpi->planes[0], image_height * dstride);
> +		const uint32_t source_stride = mpi->stride[0];
> +		const uint32_t dest_stride = dstride;
> +		const uint32_t min_stride = FFMIN(source_stride, dest_stride);
> +		uint32_t line;
> +		s = mpi->planes[0];
> +		d = image;
> +		for (line=0; line<image_height; line++) {
> +			fast_memcpy(d, s, min_stride);
> +			s += source_stride;
> +			d += dest_stride;
> +		}

Hm, I didn't read the patch properly before, but now I realize: is that
not the same thing that
memcpy_pic(image, mpi->planes[0], FFMIN(source_stride, dest_stride), dest_stride, source_stride);
does?
Except that FFMIN(source_stride, dest_stride) should actually be width *
bytes_per_pixel.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list