Commit 066cd24e authored by Laurent Aimar's avatar Laurent Aimar

Fixed kate with tiger support integration.

parent 6d633f85
...@@ -88,6 +88,7 @@ struct decoder_sys_t ...@@ -88,6 +88,7 @@ struct decoder_sys_t
* Common properties * Common properties
*/ */
mtime_t i_pts; mtime_t i_pts;
mtime_t i_max_stop;
/* decoder_sys_t is shared between decoder and spu units */ /* decoder_sys_t is shared between decoder and spu units */
vlc_mutex_t lock; vlc_mutex_t lock;
...@@ -98,7 +99,6 @@ struct decoder_sys_t ...@@ -98,7 +99,6 @@ struct decoder_sys_t
* Tiger properties * Tiger properties
*/ */
tiger_renderer *p_tr; tiger_renderer *p_tr;
subpicture_t *p_spu_final;
mtime_t last_render_ts; mtime_t last_render_ts;
bool b_dirty; bool b_dirty;
...@@ -373,6 +373,7 @@ static int OpenDecoder( vlc_object_t *p_this ) ...@@ -373,6 +373,7 @@ static int OpenDecoder( vlc_object_t *p_this )
#endif #endif
p_sys->b_ready = false; p_sys->b_ready = false;
p_sys->i_pts = 0; p_sys->i_pts = 0;
p_sys->i_max_stop = VLC_TS_INVALID;
kate_comment_init( &p_sys->kc ); kate_comment_init( &p_sys->kc );
kate_info_init( &p_sys->ki ); kate_info_init( &p_sys->ki );
...@@ -473,20 +474,18 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -473,20 +474,18 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) ) if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{
block_Release( p_block );
return NULL;
}
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY) )
{ {
#ifdef HAVE_TIGER #ifdef HAVE_TIGER
/* Hmm, should we wait before flushing the renderer ? I think not, but not certain... */ if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY)
vlc_mutex_lock( &p_sys->lock ); {
tiger_renderer_seek( p_sys->p_tr, 0 ); /* Hmm, should we wait before flushing the renderer ? I think not, but not certain... */
vlc_mutex_unlock( &p_sys->lock ); vlc_mutex_lock( &p_sys->lock );
tiger_renderer_seek( p_sys->p_tr, 0 );
vlc_mutex_unlock( &p_sys->lock );
}
#endif #endif
p_sys->i_max_stop = VLC_TS_INVALID;
block_Release( p_block ); block_Release( p_block );
return NULL; return NULL;
} }
...@@ -826,16 +825,6 @@ static void SubpictureReleaseRegions( subpicture_t *p_subpic ) ...@@ -826,16 +825,6 @@ static void SubpictureReleaseRegions( subpicture_t *p_subpic )
} }
} }
static void TigerPreRender( spu_t *p_spu, subpicture_t *p_subpic, const video_format_t *p_fmt )
{
decoder_sys_t *p_sys = p_subpic->p_sys->p_dec_sys;
VLC_UNUSED( p_spu );
VLC_UNUSED( p_fmt );
p_sys->p_spu_final = p_subpic;
}
/* /*
* We get premultiplied alpha, but VLC doesn't expect this, so we demultiply * We get premultiplied alpha, but VLC doesn't expect this, so we demultiply
* alpha to avoid double multiply (and thus thinner text than we should)). * alpha to avoid double multiply (and thus thinner text than we should)).
...@@ -914,12 +903,6 @@ static void TigerUpdateRegions( spu_t *p_spu, subpicture_t *p_subpic, const vide ...@@ -914,12 +903,6 @@ static void TigerUpdateRegions( spu_t *p_spu, subpicture_t *p_subpic, const vide
/* remember what frame we've rendered already */ /* remember what frame we've rendered already */
p_sys->last_render_ts = ts; p_sys->last_render_ts = ts;
if( p_subpic != p_sys->p_spu_final )
{
SubpictureReleaseRegions( p_subpic );
return;
}
/* time in seconds from the start of the stream */ /* time in seconds from the start of the stream */
t = (p_subpic->p_sys->i_start + ts - p_subpic->i_start ) / 1000000.0f; t = (p_subpic->p_sys->i_start + ts - p_subpic->i_start ) / 1000000.0f;
...@@ -1277,6 +1260,8 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, kate_packet *p_kp, block_t ...@@ -1277,6 +1260,8 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, kate_packet *p_kp, block_t
p_spu->p_sys->i_start = p_block->i_pts; p_spu->p_sys->i_start = p_block->i_pts;
DecSysHold( p_sys ); DecSysHold( p_sys );
p_spu->i_stop = __MAX( p_sys->i_max_stop, p_spu->i_stop );
p_spu->b_ephemer = true;
p_spu->b_absolute = true; p_spu->b_absolute = true;
/* add the event to tiger */ /* add the event to tiger */
...@@ -1285,7 +1270,6 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, kate_packet *p_kp, block_t ...@@ -1285,7 +1270,6 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, kate_packet *p_kp, block_t
vlc_mutex_unlock( &p_sys->lock ); vlc_mutex_unlock( &p_sys->lock );
/* hookup render/update routines */ /* hookup render/update routines */
p_spu->pf_pre_render = TigerPreRender;
p_spu->pf_update_regions = TigerUpdateRegions; p_spu->pf_update_regions = TigerUpdateRegions;
p_spu->pf_destroy = TigerDestroySubpicture; p_spu->pf_destroy = TigerDestroySubpicture;
} }
......
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