From 89b7e06e362f01284cd1166a019ae3fa3093a6e4 Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Wed, 14 Jan 2004 13:01:05 +0000 Subject: [PATCH] Minor mods git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@75 d19143bc-622f-0410-bfdd-b5b2a6649095 --- mlt/src/framework/mlt_frame.c | 19 +++++++++++++++++-- src/framework/mlt_frame.c | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/mlt/src/framework/mlt_frame.c b/mlt/src/framework/mlt_frame.c index cb26ee9..f2fad14 100644 --- a/mlt/src/framework/mlt_frame.c +++ b/mlt/src/framework/mlt_frame.c @@ -491,8 +491,23 @@ int mlt_frame_composite_yuv( mlt_frame this, mlt_frame that, int x, int y, float void *memfill( void *dst, void *src, int l, int elements ) { int i = 0; - for ( i = 0; i < elements; i ++ ) - dst = memcpy( dst, src, l ) + l; + if ( l == 2 ) + { + uint8_t *p = dst; + uint8_t *src1 = src; + uint8_t *src2 = src + 1; + for ( i = 0; i < elements; i ++ ) + { + *p ++ = *src1; + *p ++ = *src2; + } + dst = p; + } + else + { + for ( i = 0; i < elements; i ++ ) + dst = memcpy( dst, src, l ) + l; + } return dst; } diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index cb26ee9..f2fad14 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -491,8 +491,23 @@ int mlt_frame_composite_yuv( mlt_frame this, mlt_frame that, int x, int y, float void *memfill( void *dst, void *src, int l, int elements ) { int i = 0; - for ( i = 0; i < elements; i ++ ) - dst = memcpy( dst, src, l ) + l; + if ( l == 2 ) + { + uint8_t *p = dst; + uint8_t *src1 = src; + uint8_t *src2 = src + 1; + for ( i = 0; i < elements; i ++ ) + { + *p ++ = *src1; + *p ++ = *src2; + } + dst = p; + } + else + { + for ( i = 0; i < elements; i ++ ) + dst = memcpy( dst, src, l ) + l; + } return dst; } -- 1.7.4.4