[vlc-commits] remoteosd: remove unused parameter
Rémi Denis-Courmont
git at videolan.org
Sun Nov 11 16:33:36 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 10 14:10:27 2018 +0200| [911f41f51be0ab3e9e6a322ccbe0abd1813edcf9] | committer: Rémi Denis-Courmont
remoteosd: remove unused parameter
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=911f41f51be0ab3e9e6a322ccbe0abd1813edcf9
---
modules/spu/remoteosd.c | 75 ++++++++++++++++++++++++-------------------------
1 file changed, 36 insertions(+), 39 deletions(-)
diff --git a/modules/spu/remoteosd.c b/modules/spu/remoteosd.c
index 0167f8cd92..71bcd03aee 100644
--- a/modules/spu/remoteosd.c
+++ b/modules/spu/remoteosd.c
@@ -327,17 +327,14 @@ static void DestroyFilter( vlc_object_t *p_this )
free( p_sys );
}
-static bool read_exact( filter_t *obj, vlc_tls_t *fd, void *buf, size_t len )
+static bool read_exact( vlc_tls_t *fd, void *buf, size_t len )
{
- (void) obj;
return (ssize_t)len == vlc_tls_Read( fd, buf, len, true );
}
-static bool write_exact( filter_t *obj, vlc_tls_t *fd,
- const void *buf, size_t len )
+static bool write_exact( vlc_tls_t *fd, const void *buf, size_t len )
{
- (void) obj;
return (ssize_t)len == vlc_tls_Write( fd, buf, len );
}
@@ -358,7 +355,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
msg_Dbg( p_filter, "Reading protocol version" );
rfbProtocolVersionMsg pv;
- if ( !read_exact( p_filter, fd, pv, sz_rfbProtocolVersionMsg ) )
+ if ( !read_exact( fd, pv, sz_rfbProtocolVersionMsg ) )
{
msg_Err( p_filter, "Could not read version message" );
goto error;
@@ -369,7 +366,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
static const char version[sz_rfbProtocolVersionMsg] = "RFB 003.003\n";
- if( !write_exact(p_filter, fd, version, sz_rfbProtocolVersionMsg) )
+ if( !write_exact(fd, version, sz_rfbProtocolVersionMsg) )
{
msg_Err( p_filter, "Could not write version message" );
goto error;
@@ -377,7 +374,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
msg_Dbg( p_filter, "Reading authentication scheme" );
uint32_t i_authScheme;
- if( !read_exact( p_filter, fd, &i_authScheme, 4 ) )
+ if( !read_exact( fd, &i_authScheme, 4 ) )
{
msg_Err( p_filter, "Could not read authentication scheme" );
goto error;
@@ -393,7 +390,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
if (i_authScheme == rfbVncAuth)
{
unsigned char challenge[CHALLENGESIZE];
- if ( !read_exact( p_filter, fd, challenge, CHALLENGESIZE ) )
+ if ( !read_exact( fd, challenge, CHALLENGESIZE ) )
{
msg_Err( p_filter, "Could not read password challenge" );
goto error;
@@ -403,13 +400,13 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
if (err != VLC_SUCCESS)
return false;
- if( !write_exact(p_filter, fd, challenge, CHALLENGESIZE ) )
+ if( !write_exact(fd, challenge, CHALLENGESIZE ) )
{
msg_Err( p_filter, "Could not write password" );
goto error;
}
uint32_t i_authResult;
- if( !read_exact( p_filter, fd, &i_authResult, 4 ) )
+ if( !read_exact( fd, &i_authResult, 4 ) )
{
msg_Err( p_filter, "Could not read authentication result" );
goto error;
@@ -425,7 +422,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
msg_Dbg( p_filter, "Writing client init message" );
rfbClientInitMsg ci;
ci.shared = 1;
- if( !write_exact( p_filter, fd, &ci, sz_rfbClientInitMsg ) )
+ if( !write_exact( fd, &ci, sz_rfbClientInitMsg ) )
{
msg_Err( p_filter, "Could not write client init message" );
goto error;
@@ -433,7 +430,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
msg_Dbg( p_filter, "Reading server init message" );
rfbServerInitMsg si;
- if( !read_exact( p_filter, fd, &si, sz_rfbServerInitMsg ) )
+ if( !read_exact( fd, &si, sz_rfbServerInitMsg ) )
{
msg_Err( p_filter, "Could not read server init message" );
goto error;
@@ -467,7 +464,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
char s_ServerName[MAX_VNC_SERVER_NAME_LENGTH+1];
msg_Dbg( p_filter, "Reading server name with size = %u", i_nameLength );
- if( !read_exact( p_filter, fd, s_ServerName, i_nameLength ) )
+ if( !read_exact( fd, s_ServerName, i_nameLength ) )
{
msg_Err( p_filter, "Could not read server name" );
goto error;
@@ -506,7 +503,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
sp.format.blueShift = 0;
sp.format.pad1 = sp.format.pad2 = 0;
- if( !write_exact( p_filter, fd, &sp, sz_rfbSetPixelFormatMsg) )
+ if( !write_exact( fd, &sp, sz_rfbSetPixelFormatMsg) )
{
msg_Err( p_filter, "Could not write SetPixelFormat message" );
goto error;
@@ -519,7 +516,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
se.pad = 0;
se.nEncodings = htons( p_sys->b_alpha_from_vnc ? 3 : 2 );
- if( !write_exact( p_filter, fd, &se, sz_rfbSetEncodingsMsg) )
+ if( !write_exact( fd, &se, sz_rfbSetEncodingsMsg) )
{
msg_Err( p_filter, "Could not write SetEncodings message begin" );
goto error;
@@ -529,7 +526,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
msg_Dbg( p_filter, "Writing SetEncodings rfbEncodingCopyRect" );
i_encoding = htonl(rfbEncodingCopyRect);
- if( !write_exact( p_filter, fd, &i_encoding, 4) )
+ if( !write_exact( fd, &i_encoding, 4) )
{
msg_Err( p_filter, "Could not write encoding type rfbEncodingCopyRect." );
goto error;
@@ -537,7 +534,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
msg_Dbg( p_filter, "Writing SetEncodings rfbEncodingRRE" );
i_encoding = htonl(rfbEncodingRRE);
- if( !write_exact(p_filter, fd, &i_encoding, 4) )
+ if( !write_exact(fd, &i_encoding, 4) )
{
msg_Err( p_filter, "Could not write encoding type rfbEncodingRRE." );
goto error;
@@ -548,7 +545,7 @@ static vlc_tls_t *vnc_connect( filter_t *p_filter )
msg_Dbg( p_filter, "Writing SetEncodings rfbEncSpecialUseAlpha" );
i_encoding = 0x00F0FFFF; /* rfbEncSpecialUseAlpha is 0xFFFFF000
* before we swap it */
- if( !write_exact(p_filter, fd, &i_encoding, 4) )
+ if( !write_exact(fd, &i_encoding, 4) )
{
msg_Err( p_filter, "Could not write encoding type rfbEncSpecialUseAlpha." );
goto error;
@@ -573,7 +570,7 @@ static int write_update_request(filter_t *p_filter, bool incremental)
udr.w = htons(p_sys->i_vnc_width);
udr.h = htons(p_sys->i_vnc_height);
- int w = write_exact(p_filter, p_sys->i_socket, &udr,
+ int w = write_exact(p_sys->i_socket, &udr,
sz_rfbFramebufferUpdateRequestMsg);
if( !w )
msg_Err( p_filter, "Could not write rfbFramebufferUpdateRequestMsg." );
@@ -649,7 +646,7 @@ static void* vnc_worker_thread( void *obj )
memset( &msg, 0, sizeof(msg) );
vlc_restorecancel (canc);
- if( !read_exact(p_filter, fd, &msg, 1 ) )
+ if( !read_exact(fd, &msg, 1 ) )
{
msg_Err( p_filter, "Error while waiting for next server message");
break;
@@ -682,7 +679,7 @@ static void* vnc_worker_thread( void *obj )
if( --i_msgSize > 0 )
{
- if ( !read_exact( p_filter, fd, ((char *)&msg) + 1, i_msgSize ) )
+ if ( !read_exact( fd, ((char *)&msg) + 1, i_msgSize ) )
{
msg_Err( p_filter, "Error while reading message of type %u",
msg.type );
@@ -734,7 +731,7 @@ static bool process_server_message ( filter_t *p_filter,
for (int i_rect = 0; i_rect < msg->fu.nRects; i_rect++)
{
- if (!read_exact(p_filter, p_sys->i_socket, &hdr,
+ if (!read_exact(p_sys->i_socket, &hdr,
sz_rfbFramebufferUpdateRectHeader ) )
{
msg_Err( p_filter, "Could not read FrameBufferUpdate header" );
@@ -753,7 +750,7 @@ static bool process_server_message ( filter_t *p_filter,
int i_line;
for (i_line = 0; i_line < hdr.r.h; i_line++)
{
- if ( !read_exact( p_filter, p_sys->i_socket,
+ if ( !read_exact( p_sys->i_socket,
p_sys->read_buffer, hdr.r.w ) )
{
msg_Err( p_filter,
@@ -778,7 +775,7 @@ static bool process_server_message ( filter_t *p_filter,
{
rfbCopyRect rect;
- if ( !read_exact( p_filter, p_sys->i_socket,
+ if ( !read_exact( p_sys->i_socket,
&rect, sz_rfbCopyRect ) )
{
msg_Err( p_filter, "Could not read rfbCopyRect" );
@@ -804,14 +801,14 @@ static bool process_server_message ( filter_t *p_filter,
case rfbEncodingRRE:
{
rfbRREHeader rrehdr;
- if ( !read_exact( p_filter, p_sys->i_socket,
+ if ( !read_exact( p_sys->i_socket,
&rrehdr, sz_rfbRREHeader ) )
{
msg_Err( p_filter, "Could not read rfbRREHeader" );
return false;
}
uint8_t i_pixcolor;
- if ( !read_exact( p_filter, p_sys->i_socket,
+ if ( !read_exact( p_sys->i_socket,
&i_pixcolor, 1 ) )
{
msg_Err( p_filter, "Could not read RRE pixcolor" );
@@ -840,7 +837,7 @@ static bool process_server_message ( filter_t *p_filter,
"need %u bytes", i_datasize );
return false;
}
- if ( !read_exact( p_filter, p_sys->i_socket,
+ if ( !read_exact( p_sys->i_socket,
p_sys->read_buffer, i_datasize ) )
{
msg_Err( p_filter,
@@ -907,7 +904,7 @@ static bool process_server_message ( filter_t *p_filter,
return false;
}
- if ( !read_exact( p_filter, p_sys->i_socket,
+ if ( !read_exact( p_sys->i_socket,
p_sys->read_buffer, i_datasize ) )
{
msg_Err( p_filter, "Could not read color map data" );
@@ -954,7 +951,7 @@ static bool process_server_message ( filter_t *p_filter,
msg_Err( p_filter, "Buffer too small, need %u bytes", msg->sct.length );
return false;
}
- if ( !read_exact( p_filter, p_sys->i_socket,
+ if ( !read_exact( p_sys->i_socket,
p_sys->read_buffer, msg->sct.length ) )
{
msg_Err( p_filter, "Could not read Reading rfbServerCutText data" );
@@ -1233,7 +1230,7 @@ static int MouseEvent( filter_t *p_filter,
ev.x = htons(i_x);
ev.y = htons(i_y);
- write_exact( p_filter, p_sys->i_socket, &ev, sz_rfbPointerEventMsg);
+ write_exact( p_sys->i_socket, &ev, sz_rfbPointerEventMsg);
vlc_mutex_unlock( &p_sys->lock );
return VLC_EGENERIC;
@@ -1277,43 +1274,43 @@ static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
if (newval.i_int & KEY_MODIFIER_CTRL)
{
ev.key = 0xffe3;
- write_exact( p_filter, p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
+ write_exact( p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
}
if (newval.i_int & KEY_MODIFIER_SHIFT)
{
ev.key = 0xffe1;
- write_exact( p_filter, p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
+ write_exact( p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
}
if (newval.i_int & KEY_MODIFIER_ALT)
{
ev.key = 0xffe9;
- write_exact( p_filter, p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
+ write_exact( p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
}
/* then key-down for the pressed key */
ev.key = i_key32;
- write_exact( p_filter, p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
+ write_exact( p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
ev.down = 0;
/* then key-up for the pressed key */
- write_exact( p_filter, p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
+ write_exact( p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
/* last key-down for modifier-keys */
if (newval.i_int & KEY_MODIFIER_CTRL)
{
ev.key = 0xffe3;
- write_exact( p_filter, p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
+ write_exact( p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
}
if (newval.i_int & KEY_MODIFIER_SHIFT)
{
ev.key = 0xffe1;
- write_exact( p_filter, p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
+ write_exact( p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
}
if (newval.i_int & KEY_MODIFIER_ALT)
{
ev.key = 0xffe9;
- write_exact( p_filter, p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
+ write_exact( p_sys->i_socket, &ev, sz_rfbKeyEventMsg );
}
vlc_mutex_unlock( &p_sys->lock );
More information about the vlc-commits
mailing list