]> git.tdb.fi Git - xinema.git/commitdiff
Hook up any new clients to an existing stream
authorMikko Rasa <tdb@tdb.fi>
Fri, 16 Oct 2015 15:29:29 +0000 (18:29 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 16 Oct 2015 15:29:29 +0000 (18:29 +0300)
source/client.cpp
source/xinema.h

index f042c66b020b70d31e0c0348c098c25a04540321..47f8186d7d2899c0457568abc13f590037585bc0 100644 (file)
@@ -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)
index 3a2bae178698a742e3608f074247355e6f950609..ce0345dfeb43850bac27721e75f45e4152f7cff2 100644 (file)
@@ -36,6 +36,7 @@ private:
 
 public:
        void play_file(const Msp::FS::Path &);
+       XineStream *get_stream() const { return stream; }
 };
 
 #endif