]> git.tdb.fi Git - xinema.git/blobdiff - source/client.cpp
Fix a command processing error
[xinema.git] / source / client.cpp
index f042c66b020b70d31e0c0348c098c25a04540321..1f2164876024adc75fe4f440aa6f7938ca944dd8 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()
@@ -39,7 +42,6 @@ void Client::data_available()
                catch(const exception &e)
                {
                        send_reply(string("error ")+e.what());
-                       return;
                }
 
                start = newline+1;
@@ -96,6 +98,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)