From 63961242dfe4a7624280a2e971b92245d9f421c6 Mon Sep 17 00:00:00 2001 From: Brendan Long Date: Thu, 30 May 2013 16:00:35 -0600 Subject: [PATCH] rtspconnection: remove functions added in GLib 2.34 g_pollable_stream_read and g_pollable_stream_write were added in GLib 2.34, but Ubuntu 12.04 and Debian Wheezy still use GLib 2.32. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=701316 --- gst-libs/gst/rtsp/gstrtspconnection.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 341a616b77..5592273901 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -863,8 +863,12 @@ write_bytes (GOutputStream * stream, const guint8 * buffer, guint * idx, left = size - *idx; while (left) { - r = g_pollable_stream_write (stream, (gchar *) & buffer[*idx], left, - block, cancellable, &err); + if (block) + r = g_output_stream_write (stream, (gchar *) & buffer[*idx], left, + cancellable, &err); + else + r = g_pollable_output_stream_write_nonblocking (G_POLLABLE_OUTPUT_STREAM + (stream), (gchar *) & buffer[*idx], left, cancellable, &err); if (G_UNLIKELY (r < 0)) goto error; @@ -917,9 +921,14 @@ fill_raw_bytes (GstRTSPConnection * conn, guint8 * buffer, guint size, if (G_LIKELY (size > (guint) out)) { gssize r; - - r = g_pollable_stream_read (conn->input_stream, - (gchar *) & buffer[out], size - out, block, conn->cancellable, err); + gsize count = size - out; + if (block) + r = g_input_stream_read (conn->input_stream, (gchar *) & buffer[out], + count, conn->cancellable, err); + else + r = g_pollable_input_stream_read_nonblocking (G_POLLABLE_INPUT_STREAM + (conn->input_stream), (gchar *) & buffer[out], count, + conn->cancellable, err); if (G_UNLIKELY (r < 0)) { if (out == 0) {