[vlc-commits] demux: mkv: ProcessNavAction: negate if to prevent nesting
Filip Roséen
git at videolan.org
Sun Jul 22 23:36:12 CEST 2018
vlc | branch: master | Filip Roséen <filip at atch.se> | Sun Jul 22 08:16:35 2018 +0200| [b5ce012fad025123d9efef91f559cea744cb52ba] | committer: Jean-Baptiste Kempf
demux: mkv: ProcessNavAction: negate if to prevent nesting
By negating the protective if-condition we can get rid of one layer of
indentation.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b5ce012fad025123d9efef91f559cea744cb52ba
---
modules/demux/mkv/events.cpp | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/modules/demux/mkv/events.cpp b/modules/demux/mkv/events.cpp
index 1423ac9152..c8c68fefeb 100644
--- a/modules/demux/mkv/events.cpp
+++ b/modules/demux/mkv/events.cpp
@@ -170,21 +170,21 @@ void event_thread_t::ProcessNavAction( uint16 button, pci_t* pci )
{
demux_sys_t* p_sys = (demux_sys_t*)p_demux->p_sys;
- if ( button > 0 && button <= pci->hli.hl_gi.btn_ns )
+ if( button <= 0 || button > pci->hli.hl_gi.btn_ns )
+ return;
+
+ p_sys->dvd_interpretor.SetSPRM( 0x88, button );
+ btni_t button_ptr = pci->hli.btnit[button-1];
+ if ( button_ptr.auto_action_mode )
{
- p_sys->dvd_interpretor.SetSPRM( 0x88, button );
- btni_t button_ptr = pci->hli.btnit[button-1];
- if ( button_ptr.auto_action_mode )
- {
- vlc_mutex_unlock( &lock );
- vlc_mutex_lock( &p_sys->lock_demuxer );
+ vlc_mutex_unlock( &lock );
+ vlc_mutex_lock( &p_sys->lock_demuxer );
- // process the button action
- p_sys->dvd_interpretor.Interpret( button_ptr.cmd.bytes, 8 );
+ // process the button action
+ p_sys->dvd_interpretor.Interpret( button_ptr.cmd.bytes, 8 );
- vlc_mutex_unlock( &p_sys->lock_demuxer );
- vlc_mutex_lock( &lock );
- }
+ vlc_mutex_unlock( &p_sys->lock_demuxer );
+ vlc_mutex_lock( &lock );
}
}
More information about the vlc-commits
mailing list