~diwic/ubuntu/lucid/pulseaudio/bugfixes

« back to all changes in this revision

Viewing changes to src/modules/rtp/rtsp_client.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-09-21 10:28:25 UTC
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20090921102825-y1sv03l2jphwuttn
Tags: upstream-0.9.18
ImportĀ upstreamĀ versionĀ 0.9.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
    uint16_t port;
61
61
 
62
62
    pa_socket_client *sc;
63
 
    pa_iochannel *io;
64
63
    pa_ioline *ioline;
65
64
 
66
65
    pa_rtsp_cb_t callback;
111
110
 
112
111
    if (c->sc)
113
112
        pa_socket_client_unref(c->sc);
114
 
    if (c->ioline)
115
 
        pa_ioline_close(c->ioline);
116
 
    else if (c->io)
117
 
        pa_iochannel_free(c->io);
 
113
 
 
114
    pa_rtsp_disconnect(c);
118
115
 
119
116
    pa_xfree(c->hostname);
120
117
    pa_xfree(c->url);
187
184
    if (!s) {
188
185
        /* Keep the ioline/iochannel open as they will be freed automatically */
189
186
        c->ioline = NULL;
190
 
        c->io = NULL;
191
187
        c->callback(c, STATE_DISCONNECTED, NULL, c->userdata);
192
188
        return;
193
189
    }
303
299
        pa_log("Connection failed: %s", pa_cstrerror(errno));
304
300
        return;
305
301
    }
306
 
    pa_assert(!c->io);
307
 
    c->io = io;
 
302
    pa_assert(!c->ioline);
308
303
 
309
304
    c->ioline = pa_ioline_new(io);
310
305
    pa_ioline_set_callback(c->ioline, line_callback, c);
360
355
 
361
356
    if (c->ioline)
362
357
        pa_ioline_close(c->ioline);
363
 
    else if (c->io)
364
 
        pa_iochannel_free(c->io);
365
 
    c->io = NULL;
366
358
    c->ioline = NULL;
367
359
}
368
360
 
408
400
                        pa_headerlist* headers) {
409
401
    pa_strbuf* buf;
410
402
    char* hdrs;
411
 
    ssize_t l;
412
403
 
413
404
    pa_assert(c);
414
405
    pa_assert(c->url);
415
 
 
416
 
    if (!cmd)
417
 
        return -1;
 
406
    pa_assert(cmd);
 
407
    pa_assert(c->ioline);
418
408
 
419
409
    pa_log_debug("Sending command: %s", cmd);
420
410
 
453
443
    hdrs = pa_strbuf_tostring_free(buf);
454
444
    /*pa_log_debug("Submitting request:");
455
445
    pa_log_debug(hdrs);*/
456
 
    l = pa_iochannel_write(c->io, hdrs, strlen(hdrs));
 
446
    pa_ioline_puts(c->ioline, hdrs);
457
447
    pa_xfree(hdrs);
458
448
 
459
 
    /* FIXME: this is broken, not necessarily all bytes are written */
460
 
 
461
449
    return 0;
462
450
}
463
451