comparison libvo/vo_bl.c @ 36510:18ee133ba2f5

vo_bl: cosmetics, reindent.
author reimar
date Sat, 18 Jan 2014 13:49:18 +0000
parents eeb86b142fa7
children 6e88ef2077a4
comparison
equal deleted inserted replaced
36509:eeb86b142fa7 36510:18ee133ba2f5
235 235
236 /* adapt size of Blinkenlights UDP stream to size of movie */ 236 /* adapt size of Blinkenlights UDP stream to size of movie */
237 if (reset_width) bl->width = width; /* use width of movie */ 237 if (reset_width) bl->width = width; /* use width of movie */
238 if (reset_height) bl->height = height; /* use height of movie */ 238 if (reset_height) bl->height = height; /* use height of movie */
239 239
240 /* check for maximum size of UDP packet */ 240 /* check for maximum size of UDP packet */
241 if (12 + bl->width*bl->height*bl->channels > 65507) { 241 if (12 + bl->width*bl->height*bl->channels > 65507) {
242 mp_msg(MSGT_VO, MSGL_ERR, "bl: %dx%d-%d does not fit into an UDP packet\n", 242 mp_msg(MSGT_VO, MSGL_ERR, "bl: %dx%d-%d does not fit into an UDP packet\n",
243 bl->width, bl->height, bl->channels); 243 bl->width, bl->height, bl->channels);
244 goto err_out; 244 goto err_out;
245 } 245 }
246 246
247 /* resize or allocate frame and tmp buffers */ 247 /* resize or allocate frame and tmp buffers */
248 bl_size = 12 + bl->width*bl->height*bl->channels; 248 bl_size = 12 + bl->width*bl->height*bl->channels;
249 ptr = realloc(bl_packet, 12 + bl->width*bl->height*3); /* space for header and image data */ 249 ptr = realloc(bl_packet, 12 + bl->width*bl->height*3); /* space for header and image data */
250 if (ptr) 250 if (!ptr) {
251 bl_packet = ptr; 251 mp_msg(MSGT_VO, MSGL_ERR, "bl: out of memory error\n");
252 else { 252 goto err_out;
253 mp_msg(MSGT_VO, MSGL_ERR, "bl: out of memory error\n"); 253 }
254 goto err_out; 254 bl_packet = ptr;
255 } 255
256 image = ((unsigned char*)bl_packet + 12); /* pointer to image data */ 256 image = ((unsigned char*)bl_packet + 12); /* pointer to image data */
257 ptr = realloc(tmp, bl->width*bl->height*3); /* space for image data only */ 257 ptr = realloc(tmp, bl->width*bl->height*3); /* space for image data only */
258 if (ptr) 258 if (!ptr) {
259 tmp = ptr; 259 mp_msg(MSGT_VO, MSGL_ERR, "bl: out of memory error\n");
260 else { 260 goto err_out;
261 mp_msg(MSGT_VO, MSGL_ERR, "bl: out of memory error\n"); 261 }
262 goto err_out; 262 tmp = ptr;
263 }
264 263
265 bl_packet->magic = htonl(0x23542666); 264 bl_packet->magic = htonl(0x23542666);
266 bl_packet->width = htons(bl->width); 265 bl_packet->width = htons(bl->width);
267 bl_packet->height = htons(bl->height); 266 bl_packet->height = htons(bl->height);
268 bl_packet->channels = htons(bl->channels); 267 bl_packet->channels = htons(bl->channels);