#define spu_DestroyRegion(a,b) __spu_DestroyRegion(VLC_OBJECT(a),b)
VLC_EXPORT( void, __spu_DestroyRegion, ( vlc_object_t *, subpicture_region_t * ) );
-VLC_EXPORT( subpicture_t *, spu_SortSubpictures, ( spu_t *, mtime_t ) );
+VLC_EXPORT( subpicture_t *, spu_SortSubpictures, ( spu_t *, mtime_t, vlc_bool_t ) );
VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *, video_format_t *, picture_t *, picture_t *, subpicture_t *, int, int ) );
/** @}*/
subpicture_region_t * (*__spu_CreateRegion_inner) (vlc_object_t *, video_format_t *);
subpicture_region_t * (*__spu_MakeRegion_inner) (vlc_object_t *, video_format_t *, picture_t *);
void (*__spu_DestroyRegion_inner) (vlc_object_t *, subpicture_region_t *);
- subpicture_t * (*spu_SortSubpictures_inner) (spu_t *, mtime_t);
+ subpicture_t * (*spu_SortSubpictures_inner) (spu_t *, mtime_t, vlc_bool_t);
void (*spu_RenderSubpictures_inner) (spu_t *, video_format_t *, picture_t *, picture_t *, subpicture_t *, int, int);
char * (*stream_ReadLine_inner) (stream_t *);
stream_t * (*__stream_DemuxNew_inner) (vlc_object_t *p_obj, char *psz_demux, es_out_t *out);
vlc_bool_t b_ephemer; /**< If this flag is set to true the subtitle
will be displayed untill the next one appear */
vlc_bool_t b_fade; /**< enable fading */
+ vlc_bool_t b_pausable; /**< subpicture will be paused if
+ stream is paused */
/**@}*/
subpicture_region_t *p_region; /**< region list composing this subtitle */
p_spu = p_dec->pf_spu_buffer_new( p_dec );
if( !p_spu ) return NULL;
+ p_spu->b_pausable = VLC_TRUE;
+
p_spu->i_x = p_sys->i_x_start;
p_spu->i_x = p_spu->i_x * 3 / 4; /* FIXME: use aspect ratio for x? */
p_spu->i_y = p_sys->i_y_start;
picture_t *p_image = (picture_t *)p_dec->p_sys;
picture_t *p_pic;
+ printf("pouet\n");
+
if( pp_block == NULL || !*pp_block ) return NULL;
p_pic = p_dec->pf_vout_buffer_new( p_dec );
if( p_pic == NULL )
p_spu = p_dec->pf_spu_buffer_new( p_dec );
if( !p_spu ) return NULL;
+ p_spu->b_pausable = VLC_TRUE;
+
/* Rationale for the "p_spudec->i_rle_size * 4": we are going to
* expand the RLE stuff so that we won't need to read nibbles later
* on. This will speed things up a lot. Plus, we'll only need to do
return NULL;
}
+ p_spu->b_pausable = VLC_TRUE;
+
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
fmt.i_chroma = VLC_FOURCC('T','E','X','T');
p_spu = p_dec->pf_spu_buffer_new( p_dec );
if( !p_spu ) return NULL;
+ p_spu->b_pausable = VLC_TRUE;
+
p_spu->i_x = p_sys->i_x_start;
p_spu->i_y = p_sys->i_y_start;
p_spu->i_start = p_data->i_pts;
/* Check if we have a subpicture to overlay */
if( p_sys->p_spu )
{
- p_subpic = spu_SortSubpictures( p_sys->p_spu, p_pic->date );
+ p_subpic = spu_SortSubpictures( p_sys->p_spu, p_pic->date,
+ VLC_FALSE /* Fixme: check if stream is paused */ );
/* TODO: get another pic */
}
/* Check if we have a subpicture to send */
if( p_sys->p_spu && in->i_dts > 0)
{
- p_subpic = spu_SortSubpictures( p_sys->p_spu, in->i_dts );
+ p_subpic = spu_SortSubpictures( p_sys->p_spu, in->i_dts, VLC_FALSE );
}
else
{
display_date = 0;
current_date = mdate();
+ p_input = NULL;
+
i_loops++;
if( i_loops % 20 == 0 )
{
*/
if( display_date > 0 )
{
- p_subpic = spu_SortSubpictures( p_vout->p_spu, display_date );
+ if( !p_input )
+ 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_GetBool( p_input, "state" ) == PAUSE_S : VLC_FALSE );
}
/*
picture_t *p_pif;
vlc_value_t val, format;
DIR *path;
-
+
int i_ret;
var_Get( p_vout, "snapshot-path", &val );
memset( p_subpic, 0, sizeof(subpicture_t) );
p_subpic->i_status = RESERVED_SUBPICTURE;
p_subpic->b_absolute = VLC_TRUE;
+ p_subpic->b_pausable = VLC_FALSE;
p_subpic->b_fade = VLC_FALSE;
p_subpic->i_alpha = 0xFF;
p_subpic->p_region = 0;
p_subpic->pf_create_region = __spu_CreateRegion;
p_subpic->pf_make_region = __spu_MakeRegion;
p_subpic->pf_destroy_region = __spu_DestroyRegion;
-
+
return p_subpic;
}
* to be removed if a newer one is available), which makes it a lot
* more difficult to guess if a subpicture has to be rendered or not.
*****************************************************************************/
-subpicture_t *spu_SortSubpictures( spu_t *p_spu, mtime_t display_date )
+subpicture_t *spu_SortSubpictures( spu_t *p_spu, mtime_t display_date,
+ vlc_bool_t b_paused )
{
int i_index, i_channel;
subpicture_t *p_subpic = NULL;
if( display_date > p_spu->p_subpicture[i_index].i_stop &&
( !p_spu->p_subpicture[i_index].b_ephemer ||
p_spu->p_subpicture[i_index].i_stop >
- p_spu->p_subpicture[i_index].i_start ) )
+ p_spu->p_subpicture[i_index].i_start ) &&
+ !( p_spu->p_subpicture[i_index].b_pausable &&
+ b_paused ) )
{
/* Too late, destroy the subpic */
spu_DestroySubpicture( p_spu, &p_spu->p_subpicture[i_index] );