diff options
author | Peter Kjellerstedt <pkj@axis.com> | 2007-05-12 16:37:50 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-05-12 16:37:50 +0000 |
commit | 7ef62aac45140e5326fc4272e5488843ed8441ac (patch) | |
tree | 835fdff1f0d7a517b040847acccaeae4fdfc5766 /gst/rtsp | |
parent | 02a64fe5add29cb6733a7be4e7519a1acf557347 (diff) |
gst/rtsp/: Make channel guint8 where possible.
Original commit message from CVS:
Patch by: Peter Kjellerstedt <pkj at axis com>
* gst/rtsp/gstrtspsrc.h:
* gst/rtsp/rtspconnection.c: (rtsp_connection_receive):
* gst/rtsp/rtspmessage.c: (rtsp_message_init_data),
(rtsp_message_get_header):
* gst/rtsp/rtspmessage.h:
Make channel guint8 where possible.
Make rtsp_message_init_data() take the channel as a guint8.
* gst/rtsp/rtspdefs.c:
Fixed a typo: Timout -> Timeout
* gst/rtsp/rtspdefs.h:
Make RTSP_CHECK() behave as a statement.
* gst/rtsp/sdpmessage.c:
Avoid a compiler warning in INIT_ARRAY().
Fixes #437692.
Diffstat (limited to 'gst/rtsp')
-rw-r--r-- | gst/rtsp/gstrtspsrc.h | 2 | ||||
-rw-r--r-- | gst/rtsp/rtspconnection.c | 2 | ||||
-rw-r--r-- | gst/rtsp/rtspdefs.c | 2 | ||||
-rw-r--r-- | gst/rtsp/rtspdefs.h | 5 | ||||
-rw-r--r-- | gst/rtsp/rtspmessage.c | 4 | ||||
-rw-r--r-- | gst/rtsp/rtspmessage.h | 4 | ||||
-rw-r--r-- | gst/rtsp/sdpmessage.c | 2 |
7 files changed, 12 insertions, 9 deletions
diff --git a/gst/rtsp/gstrtspsrc.h b/gst/rtsp/gstrtspsrc.h index 1e6b623c..3bada066 100644 --- a/gst/rtsp/gstrtspsrc.h +++ b/gst/rtsp/gstrtspsrc.h @@ -90,7 +90,7 @@ struct _GstRTSPStream { gboolean added; /* for interleaved mode */ - gint channel[2]; + guint8 channel[2]; GstCaps *caps; GstPad *channelpad[2]; diff --git a/gst/rtsp/rtspconnection.c b/gst/rtsp/rtspconnection.c index 038a4aca..d806b50a 100644 --- a/gst/rtsp/rtspconnection.c +++ b/gst/rtsp/rtspconnection.c @@ -767,7 +767,7 @@ rtsp_connection_receive (RTSPConnection * conn, RTSPMessage * msg, RTSP_CHECK (rtsp_connection_read (conn, &c, 1, timeout), read_error); /* now we create a data message */ - rtsp_message_init_data (msg, (gint) c); + rtsp_message_init_data (msg, c); /* next two bytes are the length of the data */ RTSP_CHECK (rtsp_connection_read (conn, (guint8 *) & size, 2, timeout), diff --git a/gst/rtsp/rtspdefs.c b/gst/rtsp/rtspdefs.c index 70cef7e7..2c3f7b73 100644 --- a/gst/rtsp/rtspdefs.c +++ b/gst/rtsp/rtspdefs.c @@ -66,7 +66,7 @@ static const gchar *rtsp_results[] = { "Received end-of-file", "Network error: %s", "Host is not a valid IP address", - "Timout while waiting for server response", + "Timeout while waiting for server response", "Unknown error (%d)", NULL }; diff --git a/gst/rtsp/rtspdefs.h b/gst/rtsp/rtspdefs.h index 13d2401c..8a2182db 100644 --- a/gst/rtsp/rtspdefs.h +++ b/gst/rtsp/rtspdefs.h @@ -48,7 +48,10 @@ G_BEGIN_DECLS #define RTSP_CHECK(stmt, label) \ -if (G_UNLIKELY ((res = (stmt)) != RTSP_OK)) goto label +G_STMT_START { \ + if (G_UNLIKELY ((res = (stmt)) != RTSP_OK)) \ + goto label; \ +} G_STMT_END typedef enum { RTSP_OK = 0, diff --git a/gst/rtsp/rtspmessage.c b/gst/rtsp/rtspmessage.c index abd6d4db..ed622c33 100644 --- a/gst/rtsp/rtspmessage.c +++ b/gst/rtsp/rtspmessage.c @@ -167,7 +167,7 @@ rtsp_message_init_response (RTSPMessage * msg, RTSPStatusCode code, } RTSPResult -rtsp_message_init_data (RTSPMessage * msg, gint channel) +rtsp_message_init_data (RTSPMessage * msg, guint8 channel) { g_return_val_if_fail (msg != NULL, RTSP_EINVAL); @@ -255,7 +255,7 @@ rtsp_message_get_header (const RTSPMessage * msg, RTSPHeaderField field, g_return_val_if_fail (msg != NULL, RTSP_EINVAL); - if (msg->type != RTSP_MESSAGE_RESPONSE && msg->type != RTSP_MESSAGE_REQUEST) + if (msg->type == RTSP_MESSAGE_INVALID || msg->type == RTSP_MESSAGE_DATA) return RTSP_ENOTIMPL; val = g_hash_table_lookup (msg->hdr_fields, GINT_TO_POINTER (field)); diff --git a/gst/rtsp/rtspmessage.h b/gst/rtsp/rtspmessage.h index 2b91432d..089676c1 100644 --- a/gst/rtsp/rtspmessage.h +++ b/gst/rtsp/rtspmessage.h @@ -71,7 +71,7 @@ typedef struct _RTSPMessage gchar *reason; } response; struct { - gint channel; + guint8 channel; } data; } type_data; @@ -102,7 +102,7 @@ RTSPResult rtsp_message_init_response (RTSPMessage *msg, const RTSPMessage *request); RTSPResult rtsp_message_init_data (RTSPMessage *msg, - gint channel); + guint8 channel); RTSPResult rtsp_message_unset (RTSPMessage *msg); RTSPResult rtsp_message_free (RTSPMessage *msg); diff --git a/gst/rtsp/sdpmessage.c b/gst/rtsp/sdpmessage.c index 256a8ce2..2af52580 100644 --- a/gst/rtsp/sdpmessage.c +++ b/gst/rtsp/sdpmessage.c @@ -60,7 +60,7 @@ G_STMT_START { \ #define INIT_ARRAY(field,type,init_func) \ G_STMT_START { \ if (field) { \ - gint i; \ + guint i; \ for(i=0; i<field->len; i++) \ init_func (&g_array_index(field, type, i)); \ g_array_set_size (field,0); \ |