[vlc-commits] decoder: remove broken pause assertion (fix #6566)

Rémi Denis-Courmont git at videolan.org
Sat Jun 2 10:08:08 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun  2 11:06:28 2012 +0300| [80584f262fab5c9c78c352e517507466a11faee5] | committer: Rémi Denis-Courmont

decoder: remove broken pause assertion (fix #6566)

Arguably, this patch is really just a work-around for a bug in the
E/S output.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=80584f262fab5c9c78c352e517507466a11faee5
---

 src/input/decoder.c |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index f0949c0..a98367f 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -516,16 +516,17 @@ void input_DecoderChangePause( decoder_t *p_dec, bool b_paused, mtime_t i_date )
     decoder_owner_sys_t *p_owner = p_dec->p_owner;
 
     vlc_mutex_lock( &p_owner->lock );
+    /* Normally, p_owner->b_paused != b_paused here. But if a track is added
+     * while the input is paused (e.g. add sub file), then b_paused is
+     * (incorrectly) false. */
+    if( likely(p_owner->b_paused != b_paused) ) {
+        p_owner->b_paused = b_paused;
+        p_owner->pause.i_date = i_date;
+        p_owner->pause.i_ignore = 0;
+        vlc_cond_signal( &p_owner->wait_request );
 
-    assert( p_owner->b_paused != b_paused );
-
-    p_owner->b_paused = b_paused;
-    p_owner->pause.i_date = i_date;
-    p_owner->pause.i_ignore = 0;
-    vlc_cond_signal( &p_owner->wait_request );
-
-    DecoderOutputChangePause( p_dec, b_paused, i_date );
-
+        DecoderOutputChangePause( p_dec, b_paused, i_date );
+    }
     vlc_mutex_unlock( &p_owner->lock );
 }
 



More information about the vlc-commits mailing list