[MPlayer-cvslog] r23117 - trunk/libswscale/swscale-example.c

diego subversion at mplayerhq.hu
Thu Apr 26 13:05:59 CEST 2007


Author: diego
Date: Thu Apr 26 13:05:59 2007
New Revision: 23117

Log:
Allocate large memory blocks on the heap.
patch by Marc Hoffman, mmh pleasantst com


Modified:
   trunk/libswscale/swscale-example.c

Modified: trunk/libswscale/swscale-example.c
==============================================================================
--- trunk/libswscale/swscale-example.c	(original)
+++ trunk/libswscale/swscale-example.c	Thu Apr 26 13:05:59 2007
@@ -196,11 +196,11 @@ static void selfTest(uint8_t *src[3], in
 #define H 96
 
 int main(int argc, char **argv){
-	uint8_t rgb_data[W*H*4];
+	uint8_t *rgb_data = malloc (W*H*4);
 	uint8_t *rgb_src[3]= {rgb_data, NULL, NULL};
 	int rgb_stride[3]={4*W, 0, 0};
-	uint8_t data[3][W*H];
-	uint8_t *src[3]= {data[0], data[1], data[2]};
+	uint8_t *data = malloc (3*W*H);
+	uint8_t *src[3]= {data, data+W*H, data+W*H*2};
 	int stride[3]={W, W, W};
 	int x, y;
 	struct SwsContext *sws;



More information about the MPlayer-cvslog mailing list