+ picture_t *p_pic;
+ logo_list_t *p_logo_list;
+ logo_t * p_logo;
+
+ p_logo_list = p_sys->p_logo_list;
+
+ if( p_logo_list->i_next_pic < p_inpic->date )
+ {
+ /* It's time to use a new logo */
+ p_logo_list->i_counter =
+ ( p_logo_list->i_counter + 1 )%p_logo_list->i_count;
+ p_logo = &p_logo_list->p_logo[p_sys->p_logo_list->i_counter];
+ p_pic = p_logo->p_pic;
+ p_logo_list->i_next_pic = p_inpic->date + ( p_logo->i_delay != -1 ?
+ p_logo->i_delay : p_logo_list->i_delay ) * 1000;
+ if( p_pic )
+ {
+
+ p_sys->i_width =
+ p_sys->p_blend->fmt_in.video.i_width =
+ p_sys->p_blend->fmt_in.video.i_visible_width =
+ p_pic->p[Y_PLANE].i_visible_pitch;
+ p_sys->i_height =
+ p_sys->p_blend->fmt_in.video.i_height =
+ p_sys->p_blend->fmt_in.video.i_visible_height =
+ p_pic->p[Y_PLANE].i_visible_lines;
+
+ if( p_sys->pos )
+ {
+ if( p_sys->pos & SUBPICTURE_ALIGN_BOTTOM )
+ {
+ p_sys->posy = p_vout->render.i_height - p_sys->i_height;
+ }
+ else if ( !(p_sys->pos & SUBPICTURE_ALIGN_TOP) )
+ {
+ p_sys->posy = p_vout->render.i_height/2 - p_sys->i_height/2;
+ }
+ if( p_sys->pos & SUBPICTURE_ALIGN_RIGHT )
+ {
+ p_sys->posx = p_vout->render.i_width - p_sys->i_width;
+ }
+ else if ( !(p_sys->pos & SUBPICTURE_ALIGN_LEFT) )
+ {
+ p_sys->posx = p_vout->render.i_width/2 - p_sys->i_width/2;
+ }
+ }
+ }
+
+ }
+ else
+ {
+ p_logo = &p_logo_list->p_logo[p_sys->p_logo_list->i_counter];
+ p_pic = p_logo->p_pic;
+ }