[vlc-commits] commit: dvdnav: fully fix the still image assertion ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Thu Apr 15 18:59:17 CEST 2010


vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Apr 15 19:10:12 2010 +0300| [5821020e2918b25887393f6f11d4943e97d95114] | committer: Rémi Denis-Courmont 

dvdnav: fully fix the still image assertion

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()).
(cherry picked from commit b28c362339ac8ef7f3b9b1715631f304e7563418)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=5821020e2918b25887393f6f11d4943e97d95114
---

 modules/access/dvdnav.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 083f716..b8d4eb6 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -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 );
 }
 



More information about the vlc-commits mailing list