From 6cbc3daf34c0d59383dfe01360608ffc5dee2fdf Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 23 Dec 2007 18:44:32 +0000 Subject: == FFMPEG == Fixes [#7475] no video as background libswscale sets the alpha channel to 0 by default... grmbl. Added a workaround. Big endian users please complain, if it doesn't work. --- source/blender/imbuf/intern/anim.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source') diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c index e99c35e45ce..8a67c1d035f 100644 --- a/source/blender/imbuf/intern/anim.c +++ b/source/blender/imbuf/intern/anim.c @@ -720,6 +720,7 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { uint8_t* dst2[4]= { dst[0] + (anim->y - 1)*dstStride[0], 0, 0, 0 }; + int i; sws_scale(anim->img_convert_ctx, anim->pFrame->data, @@ -728,6 +729,11 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { anim->pCodecCtx->height, dst2, dstStride2); + + /* workaround: sws_scale sets alpha = 0... */ + for (i = 0; i < ibuf->x * ibuf->y; i++) { + ibuf->rect[i] |= 0xff000000; + } av_free_packet(&packet); break; -- cgit v1.2.3