mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
apexsink: Fix compiler warnings
Fix compile warnings on solaris from bzero not being declared (use memset instead), and strict-aliasing warnings (use a temporary variable).
This commit is contained in:
parent
e2ef7a2a8a
commit
10e4d6c74d
2 changed files with 31 additions and 7 deletions
|
@ -28,6 +28,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gstapexraop.h"
|
||||
|
||||
/* private constants */
|
||||
|
@ -100,7 +102,7 @@ gst_apexraop_send (int desc, void *data, size_t len)
|
|||
static int
|
||||
gst_apexraop_recv (int desc, void *data, size_t len)
|
||||
{
|
||||
bzero (data, len);
|
||||
memset (data, 0, len);
|
||||
return recv (desc, data, len, 0);
|
||||
}
|
||||
|
||||
|
@ -345,7 +347,11 @@ gst_apexraop_connect (GstApExRAOP * con)
|
|||
GST_APEX_RAOP_HDR_DEFAULT_LENGTH) <= 0)
|
||||
return GST_RTSP_STS_GONE;
|
||||
|
||||
sscanf (hreq, "%*s %d", (int *) &res);
|
||||
{
|
||||
int tmp;
|
||||
sscanf (hreq, "%*s %d", &tmp);
|
||||
res = (GstRTSPStatusCode) tmp;
|
||||
}
|
||||
|
||||
if (res != GST_RTSP_STS_OK)
|
||||
return res;
|
||||
|
@ -393,7 +399,11 @@ gst_apexraop_connect (GstApExRAOP * con)
|
|||
GST_APEX_RAOP_HDR_DEFAULT_LENGTH) <= 0)
|
||||
return GST_RTSP_STS_GONE;
|
||||
|
||||
sscanf (hreq, "%*s %d", (int *) &res);
|
||||
{
|
||||
int tmp;
|
||||
sscanf (hreq, "%*s %d", &tmp);
|
||||
res = (GstRTSPStatusCode) tmp;
|
||||
}
|
||||
|
||||
if (res != GST_RTSP_STS_OK)
|
||||
return res;
|
||||
|
@ -432,7 +442,11 @@ gst_apexraop_connect (GstApExRAOP * con)
|
|||
GST_APEX_RAOP_HDR_DEFAULT_LENGTH) <= 0)
|
||||
return GST_RTSP_STS_GONE;
|
||||
|
||||
sscanf (hreq, "%*s %d", (int *) &res);
|
||||
{
|
||||
int tmp;
|
||||
sscanf (hreq, "%*s %d", &tmp);
|
||||
res = (GstRTSPStatusCode) tmp;
|
||||
}
|
||||
|
||||
if (res != GST_RTSP_STS_OK)
|
||||
return res;
|
||||
|
@ -553,7 +567,11 @@ gst_apexraop_set_volume (GstApExRAOP * con, const guint volume)
|
|||
GST_APEX_RAOP_HDR_DEFAULT_LENGTH) <= 0)
|
||||
return GST_RTSP_STS_GONE;
|
||||
|
||||
sscanf (hreq, "%*s %d", (int *) &res);
|
||||
{
|
||||
int tmp;
|
||||
sscanf (hreq, "%*s %d", &tmp);
|
||||
res = (GstRTSPStatusCode) tmp;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -695,7 +713,11 @@ gst_apexraop_flush (GstApExRAOP * con)
|
|||
GST_APEX_RAOP_HDR_DEFAULT_LENGTH) <= 0)
|
||||
return GST_RTSP_STS_GONE;
|
||||
|
||||
sscanf (hreq, "%*s %d", (int *) &res);
|
||||
{
|
||||
int tmp;
|
||||
sscanf (hreq, "%*s %d", &tmp);
|
||||
res = (GstRTSPStatusCode) tmp;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gstapexsink.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (apexsink_debug);
|
||||
|
@ -488,7 +490,7 @@ gst_apexsink_prepare (GstAudioSink * asink, GstRingBufferSpec * spec)
|
|||
GST_APEX_RAOP_SAMPLES_PER_FRAME * GST_APEX_RAOP_BYTES_PER_SAMPLE;
|
||||
spec->segtotal = 1;
|
||||
|
||||
bzero (spec->silence_sample, sizeof (spec->silence_sample));
|
||||
memset (spec->silence_sample, 0, sizeof (spec->silence_sample));
|
||||
|
||||
GST_INFO_OBJECT (apexsink,
|
||||
"PREPARE : ApEx sink ready to stream at %dHz, %d bytes per sample, %d channels, %d bytes segments (%dkB/s)",
|
||||
|
|
Loading…
Reference in a new issue