comparison libswscale/swscale-example.c @ 30331:4398e647c2ea

swscale-example: Add comment about the use of av_{malloc,free}.
author ramiro
date Tue, 19 Jan 2010 15:42:51 +0000
parents 028ec0735169
children a31ec2f03d54
comparison
equal deleted inserted replaced
30330:a1383e528fa7 30331:4398e647c2ea
100 else if (dstFormat==PIX_FMT_RGB48BE || dstFormat==PIX_FMT_RGB48LE) 100 else if (dstFormat==PIX_FMT_RGB48BE || dstFormat==PIX_FMT_RGB48LE)
101 dstStride[i]= dstW*6; 101 dstStride[i]= dstW*6;
102 else 102 else
103 dstStride[i]= dstW*4; 103 dstStride[i]= dstW*4;
104 104
105 /* Image buffers passed into libswscale can be allocated any way you
106 * prefer, as long as they're aligned enough for the architecture, and
107 * they're freed appropriately (such as using av_free for buffers
108 * allocated with av_malloc). */
105 src[i]= av_malloc(srcStride[i]*srcH); 109 src[i]= av_malloc(srcStride[i]*srcH);
106 dst[i]= av_malloc(dstStride[i]*dstH); 110 dst[i]= av_malloc(dstStride[i]*dstH);
107 out[i]= av_malloc(refStride[i]*h); 111 out[i]= av_malloc(refStride[i]*h);
108 if (!src[i] || !dst[i] || !out[i]) { 112 if (!src[i] || !dst[i] || !out[i]) {
109 perror("Malloc"); 113 perror("Malloc");