[vlc-commits] sout: chromecast: remove flawed sout-test in Open

Filip Roséen git at videolan.org
Tue Jul 24 16:08:21 CEST 2018


vlc/vlc-3.0 | branch: master | Filip Roséen <filip at atch.se> | Mon Jul 23 19:56:57 2018 +0200| [d0a3a6e3a6d73a32ab0171b1e553affe36d4f7dc] | committer: Jean-Baptiste Kempf

sout: chromecast: remove flawed sout-test in Open

The relevant code suffers from some immediate flaws, with no real
gain:

  1. The implicit http-bind from within sout_StreamChainNew has a high
     chance of colliding with other things in vlc (most notably a
     web interface).

  2. It does not bind to the same httpd URI as is later used in the
     module, causing the check to signal false security in terms of
     usability.

  3. As the sout is created only to immediately be shut down, other
     attempts (not made within the module) to create a relevant sout
     will race with this "check".

     Just because we succeed in Open does not mean that we will
     succeed later on, nor does failure guarantee further failed
     attempts.

  4. There is no reason for us to check if a muxer is available at
     this stage as it:

        a) Does not send any data down the pipe, meaning that we might
           fail anyway when we actually get started due to, as an
           example, codec issues.

        b) Does not match what might actually be used (avformat/webm
           or avformat/mkv is selected further into the
           implementation)

        c) Is the wrong way of checking things. If we want to make
           sure that an sout is created before some other work is
           done, we should create an sout which we then use, _before_,
           other work is done.

refs: #20380
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
(cherry picked from commit b59640ec084f23c8d430f089389f1f0fb0726469)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/stream_out/chromecast/cast.cpp | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index b330b70297..6c89239f67 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -1396,7 +1396,6 @@ static int Open(vlc_object_t *p_this)
     sout_stream_sys_t *p_sys = NULL;
     intf_sys_t *p_intf = NULL;
     char *psz_ip = NULL;
-    sout_stream_t *p_sout = NULL;
     httpd_host_t *httpd_host = NULL;
     bool b_supports_video = true;
     int i_local_server_port;
@@ -1439,15 +1438,6 @@ static int Open(vlc_object_t *p_this)
         goto error;
     }
 
-    /* check if we can open the proper sout */
-    ss << "http{mux=" << DEFAULT_MUXER << "}";
-    p_sout = sout_StreamChainNew( p_stream->p_sout, ss.str().c_str(), NULL, NULL);
-    if (p_sout == NULL) {
-        msg_Dbg(p_stream, "could not create sout chain:%s", ss.str().c_str());
-        goto error;
-    }
-    sout_StreamChainDelete( p_sout, NULL );
-
     b_supports_video = var_GetBool(p_stream, SOUT_CFG_PREFIX "video");
 
     try



More information about the vlc-commits mailing list