sout: chromecast: prevent conflict between multiple chromecasts
commit710a2ef49669806e208d6845a494a01ed90b18db
authorFilip Roséen <filip@atch.se>
Mon, 23 Jul 2018 17:57:02 +0000 (23 19:57 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 24 Jul 2018 14:03:07 +0000 (24 16:03 +0200)
treeb359d832258fbb5ac9ccd0f64baf71ad321cdad6
parentc4d351ccfb6990d2ba1b4996e1a582aa5e6d8f85
sout: chromecast: prevent conflict between multiple chromecasts

In order for us to support streaming to more than one chromecast using
the same instance of libvlc (as through VLM), and with the same
options for the httpd, we will need to have a unique identifier for
each output.

These changes generates a random path upon initialization of the
relevant object, while also incorporating the current tick. There is
an extremely slim chance that two chromecast souts would try to create
the http bindings at the exact same time, but vlc_tick_now + a random
identifier is a "better safe than sorry" implementation.

In order to really dive down in the "better safe than sorry"-category,
we try three times before giving up.

fixes: #20380
fixes: #20890
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
modules/stream_out/chromecast/chromecast.h
modules/stream_out/chromecast/chromecast_ctrl.cpp