[vlc-devel] [PATCH 0/3] Chromecast file skipping and seeking

Steve Lhomme robux4 at videolabs.io
Thu Apr 28 14:33:41 CEST 2016


Because of the ~10s buffer of the Chromecast and the fact we use a broadcasting
server, whatever action we take on the local VLC player can take time to
happen on the device. This is the case when skipping to the next file in the
playlist or seeking inside of the current file.

When skipping to another file, we need to send a STOP command to the Chromecast
so it stops playing right away, regardless of its buffering. When seeking we
need to send a SEEK command to the Chromecast so it flushes its buffers.

The problem is that when we know we have no ES output left, the thread we are
in is interrupted, making the TLS communication not happen because of a 
vlc_killed() check. To solve this, I reworked the receiving threads so that
it also polls on a dummy (UDP) socket that we can trigger so the poll() stops
blocking and we can send data right away. After this change all sending &
receiving on the control channel is done in a single thread.

I would have used a simpler socket if net_Socket() was public. As it doesn't
need to be connected to work. But instead I had to create a UDP socket tied
to localhost:0.

Steve Lhomme (3):
  [RFC] chromecast: use a dummy UDP socket to notify the receiving
    thread of pending work
  chromecast: send a STOP message when we have no ES to send
  chromecast: send a dummy SEEK message when flushing is needed

 modules/stream_out/chromecast/cast.cpp            |   5 +
 modules/stream_out/chromecast/chromecast.h        |   8 +
 modules/stream_out/chromecast/chromecast_ctrl.cpp | 184 +++++++++++++++++-----
 3 files changed, 154 insertions(+), 43 deletions(-)

-- 
2.7.0



More information about the vlc-devel mailing list