[vlc-commits] demux: mkv: simplify lock logic in EventThread
Filip Roséen
git at videolan.org
Fri Jul 20 09:37:43 CEST 2018
vlc | branch: master | Filip Roséen <filip at atch.se> | Thu Jul 19 20:07:12 2018 +0200| [eac231e7662fd1df14a208fb1cf0766c8fd1e224] | committer: Thomas Guillem
demux: mkv: simplify lock logic in EventThread
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eac231e7662fd1df14a208fb1cf0766c8fd1e224
---
modules/demux/mkv/events.cpp | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/modules/demux/mkv/events.cpp b/modules/demux/mkv/events.cpp
index 776c42f817..684db42599 100644
--- a/modules/demux/mkv/events.cpp
+++ b/modules/demux/mkv/events.cpp
@@ -129,18 +129,13 @@ void event_thread_t::EventThread()
/* catch all key event */
var_AddCallback( p_demux->obj.libvlc, "key-action", EventKey, this );
- /* main loop */
- for( ;; )
+ for( vlc_mutex_locker guard( &lock );; )
{
- vlc_mutex_lock( &lock );
while( !b_abort && pending_events.empty() )
vlc_cond_wait( &wait, &lock );
if( b_abort )
- {
- vlc_mutex_unlock( &lock );
break;
- }
while( !pending_events.empty() )
{
@@ -159,8 +154,6 @@ void event_thread_t::EventThread()
pending_events.pop_front();
}
-
- vlc_mutex_unlock( &lock );
}
var_DelCallback( p_demux->obj.libvlc, "key-action", EventKey, this );
More information about the vlc-commits
mailing list