]> git.sesse.net Git - vlc/commitdiff
vout: avoid applying subtitle offset twice and modify behavior when subtitles overlap
authorJakob Leben <jleben@videolan.org>
Sun, 29 Nov 2009 11:08:36 +0000 (12:08 +0100)
committerJakob Leben <jleben@videolan.org>
Sun, 29 Nov 2009 11:12:18 +0000 (12:12 +0100)
Fixes the glitch when displaying subtitles and subtitle position != 0.
Modifies behavior when subtitles overlap: newer subtitles push older ones higher

src/video_output/vout_subpictures.c

index e440967c9cdce5a6348d67ecf1b5bb26e1275abd..47e24ea97d1493d5c607f5e5a4b3b1adc583d2ee 100644 (file)
@@ -519,17 +519,10 @@ void spu_RenderSubpictures( spu_t *p_spu,
             if( p_subpic->b_subtitle )
             {
                 area = spu_area_unscaled( area, scale );
-                if( !p_subpic->b_absolute && area.i_width > 0 && area.i_height > 0 )
-                {
-                    p_region->i_x = area.i_x;
-                    p_region->i_y = area.i_y;
-                }
                 if( p_subtitle_area )
                     p_subtitle_area[i_subtitle_area++] = area;
             }
         }
-        if( p_subpic->b_subtitle )
-            p_subpic->b_absolute = true;
     }
 
     /* */
@@ -1670,6 +1663,8 @@ static int SubpictureCmp( const void *s0, const void *s1 )
         r = IntegerCmp( p_subpic0->i_channel, p_subpic1->i_channel );
     if( !r )
         r = IntegerCmp( p_subpic0->i_order, p_subpic1->i_order );
+    //NOTE We swap subtitle order so that newer subtitles push older ones higher.
+    if( p_subpic0->b_subtitle && p_subpic1->b_subtitle ) r = !r;
     return r;
 }