Commit 26e31343 authored by Lyndon Brown's avatar Lyndon Brown Committed by Jean-Baptiste Kempf
Browse files

spu(audiobargraph,logo): simplification

(non-functional change)

flip of logic from a negative align-[top|left] check to a positive one,
duplicating order things are done in `SpuRegionPlace()`, for better
readability.

also, compacted the condition block in the logo case by dropping
unnecessary braces.
parent 6b3c3d33
......@@ -440,19 +440,19 @@ static picture_t *FilterVideo(filter_t *p_filter, picture_t *p_src)
const int i_dst_h = p_filter->fmt_out.video.i_visible_height;
if (p_sys->i_pos >= 0) {
if (p_sys->i_pos & SUBPICTURE_ALIGN_BOTTOM)
if (p_sys->i_pos & SUBPICTURE_ALIGN_TOP)
p_sys->i_pos_y = 0;
else if (p_sys->i_pos & SUBPICTURE_ALIGN_BOTTOM)
p_sys->i_pos_y = i_dst_h - p_fmt->i_visible_height;
else if (!(p_sys->i_pos & SUBPICTURE_ALIGN_TOP))
p_sys->i_pos_y = (i_dst_h - p_fmt->i_visible_height) / 2;
else
p_sys->i_pos_y = 0;
p_sys->i_pos_y = (i_dst_h - p_fmt->i_visible_height) / 2;
if (p_sys->i_pos & SUBPICTURE_ALIGN_RIGHT)
if (p_sys->i_pos & SUBPICTURE_ALIGN_LEFT)
p_sys->i_pos_x = 0;
else if (p_sys->i_pos & SUBPICTURE_ALIGN_RIGHT)
p_sys->i_pos_x = i_dst_w - p_fmt->i_visible_width;
else if (!(p_sys->i_pos & SUBPICTURE_ALIGN_LEFT))
p_sys->i_pos_x = (i_dst_w - p_fmt->i_visible_width) / 2;
else
p_sys->i_pos_x = 0;
p_sys->i_pos_x = (i_dst_w - p_fmt->i_visible_width) / 2;
}
/* */
......
......@@ -446,31 +446,19 @@ static picture_t *FilterVideo( filter_t *p_filter, picture_t *p_src )
if( p_sys->i_pos >= 0 )
{
if( p_sys->i_pos & SUBPICTURE_ALIGN_BOTTOM )
{
if( p_sys->i_pos & SUBPICTURE_ALIGN_TOP )
p_sys->i_pos_y = 0;
else if( p_sys->i_pos & SUBPICTURE_ALIGN_BOTTOM )
p_sys->i_pos_y = i_dst_h - p_fmt->i_visible_height;
}
else if ( !(p_sys->i_pos & SUBPICTURE_ALIGN_TOP) )
{
p_sys->i_pos_y = ( i_dst_h - p_fmt->i_visible_height ) / 2;
}
else
{
p_sys->i_pos_y = 0;
}
p_sys->i_pos_y = ( i_dst_h - p_fmt->i_visible_height ) / 2;
if( p_sys->i_pos & SUBPICTURE_ALIGN_RIGHT )
{
if( p_sys->i_pos & SUBPICTURE_ALIGN_LEFT )
p_sys->i_pos_x = 0;
else if( p_sys->i_pos & SUBPICTURE_ALIGN_RIGHT )
p_sys->i_pos_x = i_dst_w - p_fmt->i_visible_width;
}
else if ( !(p_sys->i_pos & SUBPICTURE_ALIGN_LEFT) )
{
p_sys->i_pos_x = ( i_dst_w - p_fmt->i_visible_width ) / 2;
}
else
{
p_sys->i_pos_x = 0;
}
p_sys->i_pos_x = ( i_dst_w - p_fmt->i_visible_width ) / 2;
}
if( p_sys->i_pos_x < 0 || p_sys->i_pos_y < 0 )
......
Supports Markdown
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