Mercurial > mplayer.hg
comparison libvo/vo_bl.c @ 36509:eeb86b142fa7
vo_bl: minor simplification of size reinit case.
author | reimar |
---|---|
date | Sat, 18 Jan 2014 13:46:54 +0000 |
parents | 449868d26489 |
children | 18ee133ba2f5 |
comparison
equal
deleted
inserted
replaced
36508:449868d26489 | 36509:eeb86b142fa7 |
---|---|
232 void * ptr; | 232 void * ptr; |
233 int reset_width = bl->width < 0; | 233 int reset_width = bl->width < 0; |
234 int reset_height = bl->height < 0; | 234 int reset_height = bl->height < 0; |
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 || reset_height) { | 237 if (reset_width) bl->width = width; /* use width of movie */ |
238 if (reset_width) { /* use width of movie */ | 238 if (reset_height) bl->height = height; /* use height of movie */ |
239 bl->width = width; | 239 |
240 } | |
241 if (reset_height) { /* use height of movie */ | |
242 bl->height = height; | |
243 } | |
244 /* check for maximum size of UDP packet */ | 240 /* check for maximum size of UDP packet */ |
245 if (12 + bl->width*bl->height*bl->channels > 65507) { | 241 if (12 + bl->width*bl->height*bl->channels > 65507) { |
246 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", |
247 bl->width, bl->height, bl->channels); | 243 bl->width, bl->height, bl->channels); |
248 goto err_out; | 244 goto err_out; |
249 } | 245 } |
250 } | |
251 | 246 |
252 /* resize or allocate frame and tmp buffers */ | 247 /* resize or allocate frame and tmp buffers */ |
253 bl_size = 12 + bl->width*bl->height*bl->channels; | 248 bl_size = 12 + bl->width*bl->height*bl->channels; |
254 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 */ |
255 if (ptr) | 250 if (ptr) |