Commit c4f35e50 authored by Laurent Aimar's avatar Laurent Aimar

Fixed SSA subtitles pause.

 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.
parent f3adfbd8
......@@ -120,7 +120,7 @@ VLC_EXPORT( subpicture_t *, spu_SortSubpictures, ( spu_t *, mtime_t display_date
* \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 ) );
/** @}*/
......
......@@ -703,7 +703,7 @@ VLC_EXPORT( void, vout_PlacePicture, ( vout_thread_t *, unsigned in
/* 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 * );
......
......@@ -2012,7 +2012,7 @@ static int transcode_video_process( sout_stream_t *p_stream,
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 */
......
......@@ -970,21 +970,22 @@ static void* RunThread( vlc_object_t *p_this )
/*
* 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
......
......@@ -321,7 +321,7 @@ static void vout_UnlockPicture( vout_thread_t *p_vout, picture_t *p_picture )
* 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;
......@@ -342,7 +342,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *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] );
......@@ -369,7 +369,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
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] );
......@@ -407,7 +407,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
/* 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;
......@@ -426,7 +426,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
/* 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] );
......
......@@ -363,7 +363,7 @@ void spu_DisplaySubpicture( spu_t *p_spu, subpicture_t *p_subpic )
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;
......@@ -389,10 +389,10 @@ void spu_RenderSubpictures( spu_t *p_spu,
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 =
......
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