diff options
| author | Daniel Mack <daniel@caiaq.de> | 2009-09-22 11:30:30 +0800 | 
|---|---|---|
| committer | Daniel Mack <daniel@caiaq.de> | 2009-09-22 11:30:30 +0800 | 
| commit | 94aa9097f4ded68623160d754a4bf2632b8efc79 (patch) | |
| tree | 94a5e1192a18f760dc00ff5b36e1f7ba36fd449b /src/modules/rtp/rtsp_client.c | |
| parent | c1e59f7d762fb147bc5250ebddb9cf5639aba522 (diff) | |
| parent | c194db71b0ff853b4f46df26e135edf63b215451 (diff) | |
Merge branch 'master' of git://0pointer.de/pulseaudio
Diffstat (limited to 'src/modules/rtp/rtsp_client.c')
| -rw-r--r-- | src/modules/rtp/rtsp_client.c | 24 | 
1 files changed, 6 insertions, 18 deletions
| diff --git a/src/modules/rtp/rtsp_client.c b/src/modules/rtp/rtsp_client.c index 915c1072..59618064 100644 --- a/src/modules/rtp/rtsp_client.c +++ b/src/modules/rtp/rtsp_client.c @@ -60,7 +60,6 @@ struct pa_rtsp_client {      uint16_t port;      pa_socket_client *sc; -    pa_iochannel *io;      pa_ioline *ioline;      pa_rtsp_cb_t callback; @@ -111,10 +110,8 @@ void pa_rtsp_client_free(pa_rtsp_client* c) {      if (c->sc)          pa_socket_client_unref(c->sc); -    if (c->ioline) -        pa_ioline_close(c->ioline); -    else if (c->io) -        pa_iochannel_free(c->io); + +    pa_rtsp_disconnect(c);      pa_xfree(c->hostname);      pa_xfree(c->url); @@ -187,7 +184,6 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {      if (!s) {          /* Keep the ioline/iochannel open as they will be freed automatically */          c->ioline = NULL; -        c->io = NULL;          c->callback(c, STATE_DISCONNECTED, NULL, c->userdata);          return;      } @@ -303,8 +299,7 @@ static void on_connection(pa_socket_client *sc, pa_iochannel *io, void *userdata          pa_log("Connection failed: %s", pa_cstrerror(errno));          return;      } -    pa_assert(!c->io); -    c->io = io; +    pa_assert(!c->ioline);      c->ioline = pa_ioline_new(io);      pa_ioline_set_callback(c->ioline, line_callback, c); @@ -360,9 +355,6 @@ void pa_rtsp_disconnect(pa_rtsp_client *c) {      if (c->ioline)          pa_ioline_close(c->ioline); -    else if (c->io) -        pa_iochannel_free(c->io); -    c->io = NULL;      c->ioline = NULL;  } @@ -408,13 +400,11 @@ static int rtsp_exec(pa_rtsp_client* c, const char* cmd,                          pa_headerlist* headers) {      pa_strbuf* buf;      char* hdrs; -    ssize_t l;      pa_assert(c);      pa_assert(c->url); - -    if (!cmd) -        return -1; +    pa_assert(cmd); +    pa_assert(c->ioline);      pa_log_debug("Sending command: %s", cmd); @@ -453,11 +443,9 @@ static int rtsp_exec(pa_rtsp_client* c, const char* cmd,      hdrs = pa_strbuf_tostring_free(buf);      /*pa_log_debug("Submitting request:");      pa_log_debug(hdrs);*/ -    l = pa_iochannel_write(c->io, hdrs, strlen(hdrs)); +    pa_ioline_puts(c->ioline, hdrs);      pa_xfree(hdrs); -    /* FIXME: this is broken, not necessarily all bytes are written */ -      return 0;  } | 
