[vlc-commits] chromecast: fix _Write return type

Alexandre Janniaux git at videolan.org
Mon Jan 25 11:37:27 UTC 2021


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Thu Jan 21 12:51:22 2021 +0100| [4a5673677385ce8fc74204fc00128618eeffd29f] | committer: Alexandre Janniaux

chromecast: fix _Write return type

vlc_tls_Write returns a ssize_t.

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

 modules/stream_out/chromecast/chromecast_communication.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/chromecast/chromecast_communication.cpp b/modules/stream_out/chromecast/chromecast_communication.cpp
index 347a15dbc6..217d7a0e56 100644
--- a/modules/stream_out/chromecast/chromecast_communication.cpp
+++ b/modules/stream_out/chromecast/chromecast_communication.cpp
@@ -449,9 +449,9 @@ int ChromecastCommunication::sendMessage( const castchannel::CastMessage &msg )
     SetDWBE(p_data, i_size);
     msg.SerializeWithCachedSizesToArray(p_data + PACKET_HEADER_LEN);
 
-    int i_ret = vlc_tls_Write(m_tls, p_data, PACKET_HEADER_LEN + i_size);
+    ssize_t i_ret = vlc_tls_Write(m_tls, p_data, PACKET_HEADER_LEN + i_size);
     delete[] p_data;
-    if (i_ret == PACKET_HEADER_LEN + i_size)
+    if (i_ret > 0 && i_ret == PACKET_HEADER_LEN + i_size)
         return VLC_SUCCESS;
 
     msg_Warn( m_module, "failed to send message %s (%s)", msg.payload_utf8().c_str(), strerror( errno ) );



More information about the vlc-commits mailing list