[#18455] The new FFMPEG version gives the wrong color
authorMartin Poirier <theeth@yahoo.com>
Tue, 31 Mar 2009 19:39:17 +0000 (19:39 +0000)
committerMartin Poirier <theeth@yahoo.com>
Tue, 31 Mar 2009 19:39:17 +0000 (19:39 +0000)
ffmpeg format switched from RGBA32 to BGR32, it's no longer needed to swap color planes.

NOTE: this commit also attempts to fix the big endian case, but since I don't have a machine to test it, I'd appreciate if someone else would.

source/blender/blenkernel/intern/writeffmpeg.c

index 378e4319223664f1854831600692e279c0cd288f..c3d8ed855a24844f3789723eebcc055b3bf5c5b3 100644 (file)
@@ -315,9 +315,9 @@ static AVFrame* generate_video_frame(uint8_t* pixels)
                        uint8_t* end = src + width * 4;
                        while (src != end) {
                                target[3] = src[3];
-                               target[2] = src[0];
+                               target[2] = src[2];
                                target[1] = src[1];
-                               target[0] = src[2];
+                               target[0] = src[0];
 
                                target += 4;
                                src += 4;
@@ -331,9 +331,9 @@ static AVFrame* generate_video_frame(uint8_t* pixels)
                        uint8_t* src = rendered_frame + width * 4 * y;
                        uint8_t* end = src + width * 4;
                        while (src != end) {
-                               target[3] = src[2];
+                               target[3] = src[0];
                                target[2] = src[1];
-                               target[1] = src[0];
+                               target[1] = src[2];
                                target[0] = src[3];
 
                                target += 4;