I have modified spu_RenderSubpictures to take a b_paused argument.
The calls to pf_pre_render/pf_update_regions could have been moved to
spu_SortSubpicture and might have been cleaner BUT the way used keeps
all time consumming tasks inside spu_RenderSubpictures.
* \param p_fmt_dst is the format of the destination picture.
* \param p_fmt_src is the format of the original(source) video.
*/
-VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *, picture_t *, const video_format_t *p_fmt_dst, subpicture_t *p_list, const video_format_t *p_fmt_src ) );
+VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *, picture_t *, const video_format_t *p_fmt_dst, subpicture_t *p_list, const video_format_t *p_fmt_src, bool b_paused ) );
/** @}*/
/* DO NOT use vout_RenderPicture unless you are in src/video_ouput */
picture_t * vout_RenderPicture ( vout_thread_t *, picture_t *,
- subpicture_t * );
+ subpicture_t *, bool b_paused );
/* DO NOT use vout_CountPictureAvailable unless your are in src/input/dec.c (no exception) */
int vout_CountPictureAvailable( vout_thread_t * );
fmt.i_sar_den = VOUT_ASPECT_FACTOR;
spu_RenderSubpictures( p_sys->p_spu, p_pic, &fmt,
- p_subpic, &id->p_decoder->fmt_out.video );
+ p_subpic, &id->p_decoder->fmt_out.video, false );
}
/* Run user specified filter chain */
/*
* Check for subpictures to display
*/
+ bool b_paused = false;
if( display_date > 0 )
{
p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, FIND_PARENT );
- p_subpic = spu_SortSubpictures( p_vout->p_spu, display_date,
- p_input ? var_GetInteger( p_input, "state" ) == PAUSE_S : false,
- b_snapshot );
+ b_paused = p_input && var_GetInteger( p_input, "state" ) == PAUSE_S;
if( p_input )
vlc_object_release( p_input );
+
+ p_subpic = spu_SortSubpictures( p_vout->p_spu, display_date, b_paused, b_snapshot );
}
/*
* Perform rendering
*/
i_displayed++;
- p_directbuffer = vout_RenderPicture( p_vout, p_filtered_picture, p_subpic );
+ p_directbuffer = vout_RenderPicture( p_vout, p_filtered_picture, p_subpic, b_paused );
/*
* Take a snapshot if requested
* thread which direct buffer needs to be displayed.
*/
picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
- subpicture_t *p_subpic )
+ subpicture_t *p_subpic, bool b_paused )
{
if( p_pic == NULL )
return NULL;
spu_RenderSubpictures( p_vout->p_spu,
PP_OUTPUTPICTURE[0], &p_vout->fmt_out,
- p_subpic, &p_vout->fmt_in );
+ p_subpic, &p_vout->fmt_in, b_paused );
vout_UnlockPicture( p_vout, PP_OUTPUTPICTURE[0] );
picture_Copy( PP_OUTPUTPICTURE[0], p_pic );
spu_RenderSubpictures( p_vout->p_spu,
PP_OUTPUTPICTURE[0], &p_vout->fmt_out,
- p_subpic, &p_vout->fmt_in );
+ p_subpic, &p_vout->fmt_in, b_paused );
vout_UnlockPicture( p_vout, PP_OUTPUTPICTURE[0] );
/* Render subpictures on the first direct buffer */
spu_RenderSubpictures( p_vout->p_spu,
p_tmp_pic, &p_vout->fmt_out,
- p_subpic, &p_vout->fmt_in );
+ p_subpic, &p_vout->fmt_in, b_paused );
if( vout_LockPicture( p_vout, &p_vout->p_picture[0] ) )
return NULL;
/* Render subpictures on the first direct buffer */
spu_RenderSubpictures( p_vout->p_spu,
&p_vout->p_picture[0], &p_vout->fmt_out,
- p_subpic, &p_vout->fmt_in );
+ p_subpic, &p_vout->fmt_in, b_paused );
}
vout_UnlockPicture( p_vout, &p_vout->p_picture[0] );
void spu_RenderSubpictures( spu_t *p_spu,
picture_t *p_pic_dst, const video_format_t *p_fmt_dst,
subpicture_t *p_subpic_list,
- const video_format_t *p_fmt_src )
+ const video_format_t *p_fmt_src, bool b_paused )
{
spu_private_t *p_sys = p_spu->p;
p_subpic = p_subpic->p_next )
{
/* */
- if( p_subpic->pf_pre_render )
+ if( !b_paused && p_subpic->pf_pre_render )
p_subpic->pf_pre_render( p_spu, p_subpic, p_fmt_dst );
- if( p_subpic->pf_update_regions )
+ if( !b_paused && p_subpic->pf_update_regions )
{
video_format_t fmt_org = *p_fmt_dst;
fmt_org.i_width =