]> git.sesse.net Git - vlc/commitdiff
* modules/video_filter/mosaic.c: Fixed a major bug with video/audio synchro.
authorChristophe Massiot <massiot@videolan.org>
Thu, 26 May 2005 13:40:35 +0000 (13:40 +0000)
committerChristophe Massiot <massiot@videolan.org>
Thu, 26 May 2005 13:40:35 +0000 (13:40 +0000)
modules/video_filter/mosaic.c

index 34c6d11bf6e41d947451ddce75c3b1d63940a64f..20e5da9c7b348fa16d6cfab844d6c87875d8437c 100644 (file)
@@ -391,10 +391,11 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         video_format_t fmt_in = {0}, fmt_out = {0};
         picture_t *p_converted;
 
-        if ( p_es->b_empty || p_es->p_picture == NULL )
+        if ( p_es->b_empty )
             continue;
 
-        if ( p_es->p_picture->date + p_sys->i_delay < date )
+        while ( p_es->p_picture != NULL
+                 && p_es->p_picture->date + p_sys->i_delay < date )
         {
             if ( p_es->p_picture->p_next != NULL )
             {
@@ -409,14 +410,20 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
                 p_es->p_picture->pf_release( p_es->p_picture );
                 p_es->p_picture = NULL;
                 p_es->pp_last = &p_es->p_picture;
-                continue;
+                break;
             }
             else
+            {
                 msg_Dbg( p_filter, "too late picture for %s (" I64Fd ")",
                          p_es->psz_id,
                          date - p_es->p_picture->date - p_sys->i_delay );
+                break;
+            }
         }
 
+        if ( p_es->p_picture == NULL )
+            continue;
+
         if ( p_sys->i_order_length == 0 )
         {
             i_real_index++;