]> git.sesse.net Git - vlc/commitdiff
dvdnav: fully fix the still image assertion
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 15 Apr 2010 16:10:12 +0000 (19:10 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 15 Apr 2010 16:13:00 +0000 (19:13 +0300)
This completes 24ae7ed55e206a37571d0d39a3d21353936f9a64. Even if the
timer is removed from the schedule, there is no warranty that it's not
pending execution, or waiting on our mutex, at the very moment.
So there is a small window of opportunity for the assertion to fail.

This removes the assertion in favor of a safer if(likely()).

modules/access/dvdnav.c

index 083f7164be6cb06d3948ec5a6efc0107546d6fb8..b8d4eb6ed5af805577e6e494cddf98ae951c0be0 100644 (file)
@@ -1259,9 +1259,11 @@ static void StillTimer( void *p_data )
     demux_sys_t    *p_sys = p_data;
 
     vlc_mutex_lock( &p_sys->still.lock );
-    assert( p_sys->still.b_enabled );
-    p_sys->still.b_enabled = false;
-    dvdnav_still_skip( p_sys->dvdnav );
+    if( likely(p_sys->still.b_enabled) )
+    {
+        p_sys->still.b_enabled = false;
+        dvdnav_still_skip( p_sys->dvdnav );
+    }
     vlc_mutex_unlock( &p_sys->still.lock );
 }