]> git.tdb.fi Git - xinema.git/blobdiff - source/client.cpp
Hook up any new clients to an existing stream
[xinema.git] / source / client.cpp
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)