Commit 4d65e300 authored by Ilkka Ollakka's avatar Ilkka Ollakka

transcode: use user given width/height on calculations

regression from 808e6123 as calculations
still used with/height instead of visible_width/height
parent 6c9aefac
...@@ -413,8 +413,8 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream, ...@@ -413,8 +413,8 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
msg_Dbg( p_stream, "source pixel aspect is %f:1", f_aspect ); msg_Dbg( p_stream, "source pixel aspect is %f:1", f_aspect );
/* Calculate scaling factor for specified parameters */ /* Calculate scaling factor for specified parameters */
if( id->p_encoder->fmt_out.video.i_width <= 0 && if( id->p_encoder->fmt_out.video.i_visible_width <= 0 &&
id->p_encoder->fmt_out.video.i_height <= 0 && p_sys->f_scale ) id->p_encoder->fmt_out.video.i_visible_height <= 0 && p_sys->f_scale )
{ {
/* Global scaling. Make sure width will remain a factor of 16 */ /* Global scaling. Make sure width will remain a factor of 16 */
float f_real_scale; float f_real_scale;
...@@ -433,26 +433,26 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream, ...@@ -433,26 +433,26 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
f_scale_width = f_real_scale; f_scale_width = f_real_scale;
f_scale_height = (float) i_new_height / (float) i_src_visible_height; f_scale_height = (float) i_new_height / (float) i_src_visible_height;
} }
else if( id->p_encoder->fmt_out.video.i_width > 0 && else if( id->p_encoder->fmt_out.video.i_visible_width > 0 &&
id->p_encoder->fmt_out.video.i_height <= 0 ) id->p_encoder->fmt_out.video.i_visible_height <= 0 )
{ {
/* Only width specified */ /* Only width specified */
f_scale_width = (float)id->p_encoder->fmt_out.video.i_width/i_src_visible_width; f_scale_width = (float)id->p_encoder->fmt_out.video.i_visible_width/i_src_visible_width;
f_scale_height = f_scale_width; f_scale_height = f_scale_width;
} }
else if( id->p_encoder->fmt_out.video.i_width <= 0 && else if( id->p_encoder->fmt_out.video.i_visible_width <= 0 &&
id->p_encoder->fmt_out.video.i_height > 0 ) id->p_encoder->fmt_out.video.i_visible_height > 0 )
{ {
/* Only height specified */ /* Only height specified */
f_scale_height = (float)id->p_encoder->fmt_out.video.i_height/i_src_visible_height; f_scale_height = (float)id->p_encoder->fmt_out.video.i_visible_height/i_src_visible_height;
f_scale_width = f_scale_height; f_scale_width = f_scale_height;
} }
else if( id->p_encoder->fmt_out.video.i_width > 0 && else if( id->p_encoder->fmt_out.video.i_visible_width > 0 &&
id->p_encoder->fmt_out.video.i_height > 0 ) id->p_encoder->fmt_out.video.i_visible_height > 0 )
{ {
/* Width and height specified */ /* Width and height specified */
f_scale_width = (float)id->p_encoder->fmt_out.video.i_width/i_src_visible_width; f_scale_width = (float)id->p_encoder->fmt_out.video.i_visible_width/i_src_visible_width;
f_scale_height = (float)id->p_encoder->fmt_out.video.i_height/i_src_visible_height; f_scale_height = (float)id->p_encoder->fmt_out.video.i_visible_height/i_src_visible_height;
} }
/* check maxwidth and maxheight */ /* check maxwidth and maxheight */
......
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