Commit aa0572e5 authored by dionoea's avatar dionoea
Browse files

We can do integer math ... as long as sizes are smaller than 2**16 we should be ok :)

parent 6675c2ba
...@@ -724,13 +724,11 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -724,13 +724,11 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
if( fmt_out.i_width == 0 && fmt_out.i_height > 0 ) if( fmt_out.i_width == 0 && fmt_out.i_height > 0 )
{ {
float f = (float)fmt_in.i_height / fmt_out.i_height; fmt_out.i_width = (fmt_in.i_width * fmt_out.i_height) / fmt_in.i_height;
fmt_out.i_width = fmt_in.i_width / f;
} }
else if( fmt_out.i_height == 0 && fmt_out.i_width > 0 ) else if( fmt_out.i_height == 0 && fmt_out.i_width > 0 )
{ {
float f = (float)fmt_in.i_width / fmt_out.i_width; fmt_out.i_height = (fmt_in.i_height * fmt_out.i_width) / fmt_in.i_width;
fmt_out.i_height = fmt_in.i_height / f;
} }
else else
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment