[vlc-devel] [PATCH] decoder: display subtitles on seek while paused

Romain Vimont rom1v at videolabs.io
Fri Apr 20 11:30:56 CEST 2018


While paused, make the SPU decoder process one block on seek, in order
to display the matching subtitle immediately.
---
 src/input/decoder.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 98817e6f39..456b103935 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -2139,9 +2139,10 @@ void input_DecoderFlush( decoder_t *p_dec )
      * a row. */
     p_owner->flushing = true;
 
-    /* Flushing video decoder when paused: increment frames_countdown in order
-     * to display one frame */
-    if( p_owner->fmt.i_cat == VIDEO_ES && p_owner->paused
+    /* Flush video/spu decoder when paused: increment frames_countdown in order
+     * to display one frame/subtitle */
+    if( p_owner->paused
+     && ( p_owner->fmt.i_cat == VIDEO_ES || p_owner->fmt.i_cat == SPU_ES )
      && p_owner->frames_countdown == 0 )
         p_owner->frames_countdown++;
 
-- 
2.17.0



More information about the vlc-devel mailing list