[vlc-commits] vnc: use local variable

Rémi Denis-Courmont git at videolan.org
Sun Feb 9 17:26:46 CET 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb  9 17:58:28 2020 +0200| [114308ec42e6bdab5a031dc081c95dc0af888d68] | committer: Rémi Denis-Courmont

vnc: use local variable

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

 modules/access/vnc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/modules/access/vnc.c b/modules/access/vnc.c
index 8dcd05c228..a1f08cb3e0 100644
--- a/modules/access/vnc.c
+++ b/modules/access/vnc.c
@@ -114,7 +114,6 @@ vlc_module_end()
 typedef struct
 {
     vlc_thread_t thread;
-    int i_cancel_state;
 
     rfbClient* p_client;
     int i_framebuffersize;
@@ -344,9 +343,9 @@ static void *DemuxThread( void *p_data )
 
     for(;;)
     {
-        p_sys->i_cancel_state = vlc_savecancel();
+        int cancel_state = vlc_savecancel();
         i_status = WaitForMessage( p_sys->p_client, p_sys->i_frame_interval );
-        vlc_restorecancel( p_sys->i_cancel_state );
+        vlc_restorecancel( cancel_state );
 
         /* Ensure we're not building frames too fast */
         /* as WaitForMessage takes only a maximum wait */
@@ -356,9 +355,9 @@ static void *DemuxThread( void *p_data )
         if ( i_status > 0 )
         {
             p_sys->p_client->frameBuffer = p_sys->p_block->p_buffer;
-            p_sys->i_cancel_state = vlc_savecancel();
+            cancel_state = vlc_savecancel();
             i_status = HandleRFBServerMessage( p_sys->p_client );
-            vlc_restorecancel( p_sys->i_cancel_state );
+            vlc_restorecancel( cancel_state );
             if ( ! i_status )
             {
                 msg_Warn( p_demux, "Cannot get announced data. Server closed ?" );



More information about the vlc-commits mailing list