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 ...@@ -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_dst is the format of the destination picture.
* \param p_fmt_src is the format of the original(source) video. * \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 ...@@ -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 */ /* DO NOT use vout_RenderPicture unless you are in src/video_ouput */
picture_t * vout_RenderPicture ( vout_thread_t *, picture_t *, 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) */ /* DO NOT use vout_CountPictureAvailable unless your are in src/input/dec.c (no exception) */
int vout_CountPictureAvailable( vout_thread_t * ); int vout_CountPictureAvailable( vout_thread_t * );
......
...@@ -2012,7 +2012,7 @@ static int transcode_video_process( sout_stream_t *p_stream, ...@@ -2012,7 +2012,7 @@ static int transcode_video_process( sout_stream_t *p_stream,
fmt.i_sar_den = VOUT_ASPECT_FACTOR; fmt.i_sar_den = VOUT_ASPECT_FACTOR;
spu_RenderSubpictures( p_sys->p_spu, p_pic, &fmt, 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 */ /* Run user specified filter chain */
......
...@@ -970,21 +970,22 @@ static void* RunThread( vlc_object_t *p_this ) ...@@ -970,21 +970,22 @@ static void* RunThread( vlc_object_t *p_this )
/* /*
* Check for subpictures to display * Check for subpictures to display
*/ */
bool b_paused = false;
if( display_date > 0 ) if( display_date > 0 )
{ {
p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, FIND_PARENT ); p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, FIND_PARENT );
p_subpic = spu_SortSubpictures( p_vout->p_spu, display_date, b_paused = p_input && var_GetInteger( p_input, "state" ) == PAUSE_S;
p_input ? var_GetInteger( p_input, "state" ) == PAUSE_S : false,
b_snapshot );
if( p_input ) if( p_input )
vlc_object_release( p_input ); vlc_object_release( p_input );
p_subpic = spu_SortSubpictures( p_vout->p_spu, display_date, b_paused, b_snapshot );
} }
/* /*
* Perform rendering * Perform rendering
*/ */
i_displayed++; 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 * Take a snapshot if requested
......
...@@ -321,7 +321,7 @@ static void vout_UnlockPicture( vout_thread_t *p_vout, picture_t *p_picture ) ...@@ -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. * thread which direct buffer needs to be displayed.
*/ */
picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, 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 ) if( p_pic == NULL )
return NULL; return NULL;
...@@ -342,7 +342,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, ...@@ -342,7 +342,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
spu_RenderSubpictures( p_vout->p_spu, spu_RenderSubpictures( p_vout->p_spu,
PP_OUTPUTPICTURE[0], &p_vout->fmt_out, 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] ); vout_UnlockPicture( p_vout, PP_OUTPUTPICTURE[0] );
...@@ -369,7 +369,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, ...@@ -369,7 +369,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
picture_Copy( PP_OUTPUTPICTURE[0], p_pic ); picture_Copy( PP_OUTPUTPICTURE[0], p_pic );
spu_RenderSubpictures( p_vout->p_spu, spu_RenderSubpictures( p_vout->p_spu,
PP_OUTPUTPICTURE[0], &p_vout->fmt_out, 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] ); vout_UnlockPicture( p_vout, PP_OUTPUTPICTURE[0] );
...@@ -407,7 +407,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, ...@@ -407,7 +407,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
/* Render subpictures on the first direct buffer */ /* Render subpictures on the first direct buffer */
spu_RenderSubpictures( p_vout->p_spu, spu_RenderSubpictures( p_vout->p_spu,
p_tmp_pic, &p_vout->fmt_out, 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] ) ) if( vout_LockPicture( p_vout, &p_vout->p_picture[0] ) )
return NULL; return NULL;
...@@ -426,7 +426,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, ...@@ -426,7 +426,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
/* Render subpictures on the first direct buffer */ /* Render subpictures on the first direct buffer */
spu_RenderSubpictures( p_vout->p_spu, spu_RenderSubpictures( p_vout->p_spu,
&p_vout->p_picture[0], &p_vout->fmt_out, &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] ); vout_UnlockPicture( p_vout, &p_vout->p_picture[0] );
......
...@@ -363,7 +363,7 @@ void spu_DisplaySubpicture( spu_t *p_spu, subpicture_t *p_subpic ) ...@@ -363,7 +363,7 @@ void spu_DisplaySubpicture( spu_t *p_spu, subpicture_t *p_subpic )
void spu_RenderSubpictures( spu_t *p_spu, void spu_RenderSubpictures( spu_t *p_spu,
picture_t *p_pic_dst, const video_format_t *p_fmt_dst, picture_t *p_pic_dst, const video_format_t *p_fmt_dst,
subpicture_t *p_subpic_list, 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; spu_private_t *p_sys = p_spu->p;
...@@ -389,10 +389,10 @@ void spu_RenderSubpictures( spu_t *p_spu, ...@@ -389,10 +389,10 @@ void spu_RenderSubpictures( spu_t *p_spu,
p_subpic = p_subpic->p_next ) 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 ); 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; video_format_t fmt_org = *p_fmt_dst;
fmt_org.i_width = 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