]> git.sesse.net Git - vlc/commitdiff
* modules/stream_out/transcode.c: fixed subtitles encoding when used with audio...
authorGildas Bazin <gbazin@videolan.org>
Sat, 30 Oct 2004 14:12:35 +0000 (14:12 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sat, 30 Oct 2004 14:12:35 +0000 (14:12 +0000)
modules/stream_out/transcode.c

index bd211ad9c18da5131455bc0a7f3f72f7ec4a184f..69601133c31d33412f612d7c68be729ff89ae8b7 100644 (file)
@@ -1411,7 +1411,6 @@ static int transcode_video_process( sout_stream_t *p_stream,
     while( (p_pic = id->p_decoder->pf_decode_video( id->p_decoder, &in )) )
     {
         subpicture_t *p_subpic = 0;
-        mtime_t i_pic_date = p_pic->date;
 
         if( p_sys->b_audio_sync )
         {
@@ -1555,7 +1554,7 @@ static int transcode_video_process( sout_stream_t *p_stream,
         /* Check if we have a subpicture to overlay */
         if( p_sys->p_spu )
         {
-            p_subpic = spu_SortSubpictures( p_sys->p_spu, i_pic_date );
+            p_subpic = spu_SortSubpictures( p_sys->p_spu, p_pic->date );
             /* TODO: get another pic */
         }
 
@@ -1874,12 +1873,19 @@ static int transcode_spu_process( sout_stream_t *p_stream,
     *out = NULL;
 
     p_subpic = id->p_decoder->pf_decode_sub( id->p_decoder, &in );
-    if( p_subpic && p_sys->b_soverlay )
+    if( !p_subpic ) return VLC_EGENERIC;
+
+    if( p_sys->b_audio_sync && p_sys->i_master_drift )
     {
-        spu_DisplaySubpicture( p_sys->p_spu, p_subpic );
+        p_subpic->i_start -= p_sys->i_master_drift;
+        if( p_subpic->i_stop ) p_subpic->i_stop -= p_sys->i_master_drift;
     }
 
-    if( p_subpic && !p_sys->b_soverlay )
+    if( p_sys->b_soverlay )
+    {
+        spu_DisplaySubpicture( p_sys->p_spu, p_subpic );
+    }
+    else
     {
         block_t *p_block;