[vlc-devel] commit: Fixed subtitle flush to not flush on pause. (Laurent Aimar )
git version control
git at videolan.org
Thu Sep 18 22:17:17 CEST 2008
vlc | branch: 0.9-bugfix | Laurent Aimar <fenrir at videolan.org> | Thu Sep 18 21:24:14 2008 +0200| [746595b377d2514d36d103b5e0239d09beaf9160] | committer: Jean-Baptiste Kempf
Fixed subtitle flush to not flush on pause.
(cherry picked from commit a6778552e3d80537e739e6b00d2b47788067dbac)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=746595b377d2514d36d103b5e0239d09beaf9160
---
src/input/decoder.c | 10 ++++++++--
src/input/input_internal.h | 1 +
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index bc5ba71..0e30948 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -327,6 +327,8 @@ void input_DecoderDiscontinuity( decoder_t * p_dec, bool b_flush )
/* Send a special block */
p_null = block_New( p_dec, 128 );
p_null->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+ if( b_flush && p_dec->fmt_in.i_cat == SPU_ES )
+ p_null->i_flags |= BLOCK_FLAG_CORE_FLUSH;
/* FIXME check for p_packetizer or b_packitized from es_format_t of input ? */
if( p_dec->p_owner->p_packetizer && b_flush )
p_null->i_flags |= BLOCK_FLAG_CORRUPTED;
@@ -1047,12 +1049,16 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
input_thread_t *p_input = p_dec->p_owner->p_input;
vout_thread_t *p_vout;
subpicture_t *p_spu;
- bool b_flush = p_dec->p_owner->i_preroll_end == INT64_MAX;
+ bool b_flushing = p_dec->p_owner->i_preroll_end == INT64_MAX;
+ bool b_flush = false;
if( p_block )
+ {
DecoderUpdatePreroll( &p_dec->p_owner->i_preroll_end, p_block );
+ b_flush = (p_block->i_flags & BLOCK_FLAG_CORE_FLUSH) != 0;
+ }
- if( !b_flush && p_dec->p_owner->i_preroll_end == INT64_MAX && p_sys->p_spu_vout )
+ if( !b_flushing && b_flush && p_sys->p_spu_vout )
{
p_vout = vlc_object_find( p_dec, VLC_OBJECT_VOUT, FIND_ANYWHERE );
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index 20ef0f5..c08cead 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -329,6 +329,7 @@ void stream_AccessReset( stream_t *s );
void stream_AccessUpdate( stream_t *s );
/* decoder.c */
+#define BLOCK_FLAG_CORE_FLUSH (1 <<BLOCK_FLAG_CORE_PRIVATE_SHIFT)
void input_DecoderDiscontinuity( decoder_t * p_dec, bool b_flush );
bool input_DecoderEmpty( decoder_t * p_dec );
int input_DecoderSetCcState( decoder_t *, bool b_decode, int i_channel );
More information about the vlc-devel
mailing list