]> git.tdb.fi Git - xinema.git/blobdiff - source/xinestream.cpp
Also send the current position when a client connects
[xinema.git] / source / xinestream.cpp
index 49ed80c122d8fea3d50c11a55e995a8db3ff2004..8099f3b3eb453b0fd4f8ccf9b661b19166d420d9 100644 (file)
@@ -13,9 +13,8 @@ XineStream::XineStream(XineEngine &e, const string &mrl):
        channels_changed(false)
 {
        stream = xine_stream_new(engine.get_engine(), engine.get_audio_driver(), engine.get_video_driver());
-       xine_open(stream, mrl.c_str());
-
        queue = xine_event_new_queue(stream);
+       xine_open(stream, mrl.c_str());
 
        update_channels();
        update_info();
@@ -32,26 +31,6 @@ XineStream::~XineStream()
        xine_dispose(stream);
 }
 
-void XineStream::select_audio_channel(int i)
-{
-       if(i>=0 && static_cast<unsigned>(i)>=audio_channels.size())
-               throw out_of_range("XineStream::set_audio_channel");
-
-       if(i<0)
-               i = OFF;
-       xine_set_param(stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL, (i==OFF ? -2 : i));
-}
-
-void XineStream::select_spu_channel(int i)
-{
-       if(i>=0 && static_cast<unsigned>(i)>=spu_channels.size())
-               throw out_of_range("XineStream::set_spu_channel");
-
-       if(i<0)
-               i = OFF;
-       xine_set_param(stream, XINE_PARAM_SPU_CHANNEL, (i==OFF ? -2 : i));
-}
-
 void XineStream::play()
 {
        if(state==STOPPED)
@@ -97,6 +76,26 @@ void XineStream::set_state(State s)
        signal_state_changed.emit(state);
 }
 
+void XineStream::select_audio_channel(int i)
+{
+       if(i>=0 && static_cast<unsigned>(i)>=audio_channels.size())
+               throw out_of_range("XineStream::set_audio_channel");
+
+       if(i<0)
+               i = OFF;
+       xine_set_param(stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL, (i==OFF ? -2 : i));
+}
+
+void XineStream::select_spu_channel(int i)
+{
+       if(i>=0 && static_cast<unsigned>(i)>=spu_channels.size())
+               throw out_of_range("XineStream::set_spu_channel");
+
+       if(i<0)
+               i = OFF;
+       xine_set_param(stream, XINE_PARAM_SPU_CHANNEL, (i==OFF ? -2 : i));
+}
+
 void XineStream::tick()
 {
        while(xine_event_t *event = xine_event_get(queue))