]> git.sesse.net Git - vlc/blobdiff - src/video_output/video_output.c
Improved subtitle rendering accuracy and fixed pause on dynamic subtitles.
[vlc] / src / video_output / video_output.c
index 5b9e730eb9fcb62f0cbd2cf32f566548a0bf669c..280d0bead1e9c89b79660cdb33e52112a81df467 100644 (file)
@@ -1177,17 +1177,24 @@ static void* RunThread( void *p_this )
         /*
          * Check for subpictures to display
          */
+        mtime_t spu_render_time;
+        if( p_vout->p->b_paused )
+            spu_render_time = p_vout->p->i_pause_date;
+        else
+            spu_render_time = p_picture ? p_picture->date : mdate();
+
         subpicture_t *p_subpic = NULL;
-        if( display_date > 0 )
-            p_subpic = spu_SortSubpictures( p_vout->p_spu, display_date,
-                                            p_vout->p->b_paused, b_snapshot );
+        if( spu_render_time > 1 )
+            p_subpic = spu_SortSubpictures( p_vout->p_spu,
+                                            spu_render_time, b_snapshot );
 
         /*
          * Perform rendering
          */
         p_vout->p->i_picture_displayed++;
-        p_directbuffer = vout_RenderPicture( p_vout, p_filtered_picture,
-                                             p_subpic, p_vout->p->b_paused );
+        p_directbuffer = vout_RenderPicture( p_vout,
+                                             p_filtered_picture, p_subpic,
+                                             spu_render_time );
 
         /*
          * Take a snapshot if requested