[vlc-commits] chromecast: fix deprecation warning

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


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Wed Jan 20 12:16:57 2021 +0100| [0c6490e368dc67a86ac2144ab7498a0273df9350] | committer: Alexandre Janniaux

chromecast: fix deprecation warning

ByteSizeLong is available since 2016-09-23 version 3.1.0 according to
protobuf CHANGES.txt.

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

 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 217d7a0e56..71bf51be75 100644
--- a/modules/stream_out/chromecast/chromecast_communication.cpp
+++ b/modules/stream_out/chromecast/chromecast_communication.cpp
@@ -437,7 +437,7 @@ unsigned ChromecastCommunication::msgPlayerSetVolume( const std::string& destina
  */
 int ChromecastCommunication::sendMessage( const castchannel::CastMessage &msg )
 {
-    int i_size = msg.ByteSize();
+    size_t i_size = msg.ByteSizeLong();
     uint8_t *p_data = new(std::nothrow) uint8_t[PACKET_HEADER_LEN + i_size];
     if (p_data == NULL)
         return VLC_ENOMEM;
@@ -451,7 +451,7 @@ int ChromecastCommunication::sendMessage( const castchannel::CastMessage &msg )
 
     ssize_t i_ret = vlc_tls_Write(m_tls, p_data, PACKET_HEADER_LEN + i_size);
     delete[] p_data;
-    if (i_ret > 0 && i_ret == PACKET_HEADER_LEN + i_size)
+    if (i_ret > 0 && (size_t)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