From fd185066571a02bb59228df7df9b4f717f81a6fd Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Mon, 8 Jan 2007 12:45:10 +0000 Subject: ext/jpeg/: These libjpeg callbacks should return a 'boolean' (unsigned char apparently) and not a 'gboolean' (which m... Original commit message from CVS: Patch by: Vincent Torri * ext/jpeg/gstjpegdec.c: * ext/jpeg/gstjpegenc.c: * ext/jpeg/smokecodec.c: These libjpeg callbacks should return a 'boolean' (unsigned char apparently) and not a 'gboolean' (which maps to gint). Fixes warnings when compiling with MingW (#393427). * gst/rtsp/rtspconnection.c: (rtsp_connection_read): Use ioctlsocket on win32. * gst/udp/gstudpsrc.c: (gst_udpsrc_create): Some printf format fixes for win32. --- gst/rtsp/rtspconnection.c | 11 +++++++++-- gst/udp/gstudpsrc.c | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'gst') diff --git a/gst/rtsp/rtspconnection.c b/gst/rtsp/rtspconnection.c index 848f502f..a0603911 100644 --- a/gst/rtsp/rtspconnection.c +++ b/gst/rtsp/rtspconnection.c @@ -50,7 +50,6 @@ #include #include #include -#include /* we include this here to get the G_OS_* defines */ #include @@ -58,6 +57,7 @@ #ifdef G_OS_WIN32 #include #else +#include #include #include #include @@ -90,8 +90,10 @@ G_STMT_START { \ } G_STMT_END #ifdef G_OS_WIN32 +#define IOCTL_SOCKET ioctlsocket #define CLOSE_SOCKET(sock) closesocket(sock); #else +#define IOCTL_SOCKET ioctl #define CLOSE_SOCKET(sock) close(sock); #endif @@ -489,7 +491,12 @@ rtsp_connection_read (RTSPConnection * conn, gpointer data, guint size) fd_set readfds; guint toread; gint retval; + +#ifndef G_OS_WIN32 gint avail; +#else + gulong avail; +#endif g_return_val_if_fail (conn != NULL, RTSP_EINVAL); g_return_val_if_fail (data != NULL, RTSP_EINVAL); @@ -501,7 +508,7 @@ rtsp_connection_read (RTSPConnection * conn, gpointer data, guint size) /* if the call fails, just go in the select.. it should not fail. Else if * there is enough data to read, skip the select call al together.*/ - if (ioctl (conn->fd, FIONREAD, &avail) < 0) + if (IOCTL_SOCKET (conn->fd, FIONREAD, &avail) < 0) avail = 0; else if (avail >= toread) goto do_read; diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index d90efade..b3e4b42d 100644 --- a/gst/udp/gstudpsrc.c +++ b/gst/udp/gstudpsrc.c @@ -420,7 +420,7 @@ gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf) if ((ret = IOCTL_SOCKET (udpsrc->sock, FIONREAD, &readsize)) < 0) goto ioctl_failed; - GST_LOG_OBJECT (udpsrc, "ioctl says %d bytes available", readsize); + GST_LOG_OBJECT (udpsrc, "ioctl says %d bytes available", (int) readsize); pktdata = g_malloc (readsize); pktsize = readsize; @@ -447,7 +447,7 @@ gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf) gst_buffer_set_caps (GST_BUFFER_CAST (outbuf), udpsrc->caps); - GST_LOG_OBJECT (udpsrc, "read %d bytes", readsize); + GST_LOG_OBJECT (udpsrc, "read %d bytes", (int) readsize); *buf = GST_BUFFER_CAST (outbuf); -- cgit