diff --git a/include/vlc_osd.h b/include/vlc_osd.h index a3853905411ac7ab97767b43cc15f28c0fcc4b56..cb78626c3d8ed610c42be86bc73c530fa2d71559 100644 --- a/include/vlc_osd.h +++ b/include/vlc_osd.h @@ -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 ) ); /** @}*/ diff --git a/include/vlc_vout.h b/include/vlc_vout.h index d5409b8969c18ca5a8580ba03262e5a8dfcf6ed1..584942fc339b1c367e3a0055f6d41111547c1894 100644 --- a/include/vlc_vout.h +++ b/include/vlc_vout.h @@ -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 * ); diff --git a/modules/stream_out/transcode.c b/modules/stream_out/transcode.c index c00374bd141f18d7f39e1bdc082c99c251620a17..7d1f7e260b040e5ff10ba9d28e89c4405cd46876 100644 --- a/modules/stream_out/transcode.c +++ b/modules/stream_out/transcode.c @@ -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 */ diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index e845d6882f66554976994ed18a98126bc816d1f9..0da340638fa7a6a4d9da10828a66014e117cc39b 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -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 diff --git a/src/video_output/vout_pictures.c b/src/video_output/vout_pictures.c index 4373579a40a3bd39d9669f6677f157550736f061..f1b4d8797e1090fc11eb90e7853b09ff3573938d 100644 --- a/src/video_output/vout_pictures.c +++ b/src/video_output/vout_pictures.c @@ -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] ); diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c index f4b2ad544f9c90841e8d570c340af3e7462c0e52..c497198db7a85ac309b62dc7c148ae6450eebc91 100644 --- a/src/video_output/vout_subpictures.c +++ b/src/video_output/vout_subpictures.c @@ -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 =