comparison lclenc.c @ 9745:2b2cf4039589 libavcodec

Remove superfluous () from lclenc.c
author reimar
date Sun, 31 May 2009 08:41:11 +0000
parents bcd71ae6ea74
children e8421cfcc381
comparison
equal deleted inserted replaced
9744:bcd71ae6ea74 9745:2b2cf4039589
92 if(avctx->pix_fmt != PIX_FMT_BGR24){ 92 if(avctx->pix_fmt != PIX_FMT_BGR24){
93 av_log(avctx, AV_LOG_ERROR, "Format not supported!\n"); 93 av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
94 return -1; 94 return -1;
95 } 95 }
96 96
97 zret = deflateReset(&(c->zstream)); 97 zret = deflateReset(&c->zstream);
98 if (zret != Z_OK) { 98 if (zret != Z_OK) {
99 av_log(avctx, AV_LOG_ERROR, "Deflate reset error: %d\n", zret); 99 av_log(avctx, AV_LOG_ERROR, "Deflate reset error: %d\n", zret);
100 return -1; 100 return -1;
101 } 101 }
102 c->zstream.next_out = c->comp_buf; 102 c->zstream.next_out = c->comp_buf;
103 c->zstream.avail_out = c->max_comp_size; 103 c->zstream.avail_out = c->max_comp_size;
104 104
105 for(i = avctx->height - 1; i >= 0; i--) { 105 for(i = avctx->height - 1; i >= 0; i--) {
106 c->zstream.next_in = p->data[0]+p->linesize[0]*i; 106 c->zstream.next_in = p->data[0]+p->linesize[0]*i;
107 c->zstream.avail_in = avctx->width*3; 107 c->zstream.avail_in = avctx->width*3;
108 zret = deflate(&(c->zstream), Z_NO_FLUSH); 108 zret = deflate(&c->zstream, Z_NO_FLUSH);
109 if (zret != Z_OK) { 109 if (zret != Z_OK) {
110 av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret); 110 av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret);
111 return -1; 111 return -1;
112 } 112 }
113 } 113 }
114 zret = deflate(&(c->zstream), Z_FINISH); 114 zret = deflate(&c->zstream, Z_FINISH);
115 if (zret != Z_STREAM_END) { 115 if (zret != Z_STREAM_END) {
116 av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret); 116 av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret);
117 return -1; 117 return -1;
118 } 118 }
119 119
167 c->avctx->extradata_size= 8; 167 c->avctx->extradata_size= 8;
168 168
169 c->zstream.zalloc = Z_NULL; 169 c->zstream.zalloc = Z_NULL;
170 c->zstream.zfree = Z_NULL; 170 c->zstream.zfree = Z_NULL;
171 c->zstream.opaque = Z_NULL; 171 c->zstream.opaque = Z_NULL;
172 zret = deflateInit(&(c->zstream), c->compression); 172 zret = deflateInit(&c->zstream, c->compression);
173 if (zret != Z_OK) { 173 if (zret != Z_OK) {
174 av_log(avctx, AV_LOG_ERROR, "Deflate init error: %d\n", zret); 174 av_log(avctx, AV_LOG_ERROR, "Deflate init error: %d\n", zret);
175 return 1; 175 return 1;
176 } 176 }
177 177
195 { 195 {
196 LclEncContext *c = avctx->priv_data; 196 LclEncContext *c = avctx->priv_data;
197 197
198 av_freep(&avctx->extradata); 198 av_freep(&avctx->extradata);
199 av_freep(&c->comp_buf); 199 av_freep(&c->comp_buf);
200 deflateEnd(&(c->zstream)); 200 deflateEnd(&c->zstream);
201 201
202 return 0; 202 return 0;
203 } 203 }
204 204
205 AVCodec zlib_encoder = { 205 AVCodec zlib_encoder = {