From 0ebb4044ca544358d6d944a89fd9f6e806528be4 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 16 Oct 2015 18:29:29 +0300 Subject: [PATCH] Hook up any new clients to an existing stream --- source/client.cpp | 5 +++++ source/xinema.h | 1 + 2 files changed, 6 insertions(+) diff --git a/source/client.cpp b/source/client.cpp index f042c66..47f8186 100644 --- a/source/client.cpp +++ b/source/client.cpp @@ -17,6 +17,9 @@ Client::Client(Xinema &x, Net::StreamSocket *s): socket->signal_end_of_file.connect(sigc::mem_fun(this, &Client::end_of_stream)); xinema.signal_stream_created.connect(sigc::mem_fun(this, &Client::stream_created)); + XineStream *stream = xinema.get_stream(); + if(stream) + stream_created(*stream); } void Client::data_available() @@ -96,6 +99,8 @@ void Client::stream_created(XineStream &stream) string title = stream.get_title(); if(!title.empty()) send_reply("title "+title); + if(const Time::TimeDelta &dur = stream.get_duration()) + stream_duration_changed(dur); } void Client::stream_title_changed(const string &title) diff --git a/source/xinema.h b/source/xinema.h index 3a2bae1..ce0345d 100644 --- a/source/xinema.h +++ b/source/xinema.h @@ -36,6 +36,7 @@ private: public: void play_file(const Msp::FS::Path &); + XineStream *get_stream() const { return stream; } }; #endif -- 2.45.2