[vlc-commits] chromecast: use vlc_tls_GetPollFD()

Rémi Denis-Courmont git at videolan.org
Sun Nov 18 16:57:11 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 17 21:47:57 2018 +0200| [442f379980c707f0cfba1e47223844cb21800e9e] | committer: Rémi Denis-Courmont

chromecast: use vlc_tls_GetPollFD()

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

 modules/stream_out/chromecast/chromecast_communication.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/stream_out/chromecast/chromecast_communication.cpp b/modules/stream_out/chromecast/chromecast_communication.cpp
index 59df59a016..263cfc5af6 100644
--- a/modules/stream_out/chromecast/chromecast_communication.cpp
+++ b/modules/stream_out/chromecast/chromecast_communication.cpp
@@ -121,9 +121,6 @@ int ChromecastCommunication::buildMessage(const std::string & namespace_,
 ssize_t ChromecastCommunication::receive( uint8_t *p_data, size_t i_size, int i_timeout, bool *pb_timeout )
 {
     ssize_t i_received = 0;
-    struct pollfd ufd[1];
-    ufd[0].fd = vlc_tls_GetFD( m_tls );
-    ufd[0].events = POLLIN;
 
     struct iovec iov;
     iov.iov_base = p_data;
@@ -146,6 +143,11 @@ ssize_t ChromecastCommunication::receive( uint8_t *p_data, size_t i_size, int i_
             {
                 return -1;
             }
+
+            struct pollfd ufd[1];
+            ufd[0].events = POLLIN;
+            ufd[0].fd = vlc_tls_GetPollFD( m_tls, &ufd[0].events );
+
             ssize_t val = vlc_poll_i11e(ufd, 1, i_timeout);
             if ( val < 0 )
                 return -1;



More information about the vlc-commits mailing list