vlc | branch: master | Steve Lhomme <[email protected]> | Fri Dec 18 10:39:38 2015 +0100| [ecacf6f0dd8694d16daf1f9c227814cc1f6360d0] | committer: Thomas Guillem
stream_output: add sout_InputFlush() when seeking during stream output we need to be able to flush internal buffers Signed-off-by: Thomas Guillem <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ecacf6f0dd8694d16daf1f9c227814cc1f6360d0 --- include/vlc_sout.h | 8 ++++++++ src/input/decoder.c | 6 ++++++ src/stream_output/stream_output.c | 10 ++++++++++ src/stream_output/stream_output.h | 1 + 4 files changed, 25 insertions(+) diff --git a/include/vlc_sout.h b/include/vlc_sout.h index 8147131..0569e28 100644 --- a/include/vlc_sout.h +++ b/include/vlc_sout.h @@ -210,6 +210,7 @@ struct sout_stream_t /* manage a packet */ int (*pf_send)( sout_stream_t *, sout_stream_id_sys_t *, block_t* ); int (*pf_control)( sout_stream_t *, int, va_list ); + void (*pf_flush)( sout_stream_t *, sout_stream_id_sys_t * ); sout_stream_sys_t *p_sys; bool pace_nocontrol; @@ -237,6 +238,13 @@ static inline int sout_StreamIdSend( sout_stream_t *s, return s->pf_send( s, id, b ); } +static inline void sout_StreamFlush( sout_stream_t *s, + sout_stream_id_sys_t *id ) +{ + if (s->pf_flush) + s->pf_flush( s, id ); +} + static inline int sout_StreamControl( sout_stream_t *s, int i_query, ... ) { va_list args; diff --git a/src/input/decoder.c b/src/input/decoder.c index 12f97a5..5be414d 100644 --- a/src/input/decoder.c +++ b/src/input/decoder.c @@ -1389,6 +1389,12 @@ static void DecoderProcessFlush( decoder_t *p_dec ) if ( p_dec->pf_flush != NULL ) p_dec->pf_flush( p_dec ); +#ifdef ENABLE_SOUT + if ( p_owner->p_sout_input != NULL ) + { + sout_InputFlush( p_owner->p_sout_input ); + } +#endif if( p_dec->fmt_out.i_cat == AUDIO_ES ) { if( p_owner->p_aout ) diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c index cf8c94f..c20f3f1 100644 --- a/src/stream_output/stream_output.c +++ b/src/stream_output/stream_output.c @@ -223,6 +223,15 @@ bool sout_InputIsEmpty( sout_packetizer_input_t *p_input ) return b; } +void sout_InputFlush( sout_packetizer_input_t *p_input ) +{ + sout_instance_t *p_sout = p_input->p_sout; + + vlc_mutex_lock( &p_sout->lock ); + sout_StreamFlush( p_sout->p_stream, p_input->id ); + vlc_mutex_unlock( &p_sout->lock ); +} + /***************************************************************************** * *****************************************************************************/ @@ -789,6 +798,7 @@ static sout_stream_t *sout_StreamNew( sout_instance_t *p_sout, char *psz_name, p_stream->psz_name = psz_name; p_stream->p_cfg = p_cfg; p_stream->p_next = p_next; + p_stream->pf_flush = NULL; p_stream->pf_control = NULL; p_stream->pace_nocontrol = false; p_stream->p_sys = NULL; diff --git a/src/stream_output/stream_output.h b/src/stream_output/stream_output.h index 1429584..f1e0fd7 100644 --- a/src/stream_output/stream_output.h +++ b/src/stream_output/stream_output.h @@ -50,5 +50,6 @@ sout_packetizer_input_t *sout_InputNew( sout_instance_t *, es_format_t * ); int sout_InputDelete( sout_packetizer_input_t * ); int sout_InputSendBuffer( sout_packetizer_input_t *, block_t* ); bool sout_InputIsEmpty(sout_packetizer_input_t *); +void sout_InputFlush( sout_packetizer_input_t * ); #endif _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
