== FFMPEG ==
authorPeter Schlaile <peter@schlaile.de>
Sun, 23 Dec 2007 18:44:32 +0000 (18:44 +0000)
committerPeter Schlaile <peter@schlaile.de>
Sun, 23 Dec 2007 18:44:32 +0000 (18:44 +0000)
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

index e99c35e45ce1b65b6c78d75fcf5e224f4ae30a14..8a67c1d035f45f3093337e32cf524a29a042de79 100644 (file)
@@ -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;