mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
Fixes for -Waggregate-return
The flag wasn't added due to libexif using aggregate return values.
This commit is contained in:
parent
5ebf6444cb
commit
a9a7b8e372
5 changed files with 16 additions and 45 deletions
|
@ -183,8 +183,8 @@ typedef struct AVExtFloat
|
||||||
guint8 mantissa[8];
|
guint8 mantissa[8];
|
||||||
} AVExtFloat;
|
} AVExtFloat;
|
||||||
|
|
||||||
static AVExtFloat
|
static void
|
||||||
av_dbl2ext (double d)
|
gst_aiff_mux_write_ext (GstByteWriter * writer, double d)
|
||||||
{
|
{
|
||||||
struct AVExtFloat ext = { {0} };
|
struct AVExtFloat ext = { {0} };
|
||||||
gint e, i;
|
gint e, i;
|
||||||
|
@ -207,7 +207,9 @@ av_dbl2ext (double d)
|
||||||
}
|
}
|
||||||
if (d < 0)
|
if (d < 0)
|
||||||
ext.exponent[0] |= 0x80;
|
ext.exponent[0] |= 0x80;
|
||||||
return ext;
|
|
||||||
|
gst_byte_writer_put_data (writer, ext.exponent, 2);
|
||||||
|
gst_byte_writer_put_data (writer, ext.mantissa, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -218,8 +220,6 @@ static void
|
||||||
gst_aiff_mux_write_comm_header (GstAiffMux * aiffmux, guint audio_data_size,
|
gst_aiff_mux_write_comm_header (GstAiffMux * aiffmux, guint audio_data_size,
|
||||||
GstByteWriter * writer)
|
GstByteWriter * writer)
|
||||||
{
|
{
|
||||||
AVExtFloat sample_rate = av_dbl2ext (aiffmux->rate);
|
|
||||||
|
|
||||||
gst_byte_writer_put_uint32_le (writer, GST_MAKE_FOURCC ('C', 'O', 'M', 'M'));
|
gst_byte_writer_put_uint32_le (writer, GST_MAKE_FOURCC ('C', 'O', 'M', 'M'));
|
||||||
gst_byte_writer_put_uint32_be (writer, 18);
|
gst_byte_writer_put_uint32_be (writer, 18);
|
||||||
gst_byte_writer_put_uint16_be (writer, aiffmux->channels);
|
gst_byte_writer_put_uint16_be (writer, aiffmux->channels);
|
||||||
|
@ -227,8 +227,7 @@ gst_aiff_mux_write_comm_header (GstAiffMux * aiffmux, guint audio_data_size,
|
||||||
gst_byte_writer_put_uint32_be (writer,
|
gst_byte_writer_put_uint32_be (writer,
|
||||||
(audio_data_size * 8) / (aiffmux->width * aiffmux->channels));
|
(audio_data_size * 8) / (aiffmux->width * aiffmux->channels));
|
||||||
gst_byte_writer_put_uint16_be (writer, aiffmux->depth);
|
gst_byte_writer_put_uint16_be (writer, aiffmux->depth);
|
||||||
gst_byte_writer_put_data (writer, (const guint8 *) &sample_rate,
|
gst_aiff_mux_write_ext (writer, aiffmux->rate);
|
||||||
sizeof (AVExtFloat));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1267,7 +1267,7 @@ gst_asf_mux_start_file (GstAsfMux * asfmux)
|
||||||
gst_pad_push_event (asfmux->srcpad,
|
gst_pad_push_event (asfmux->srcpad,
|
||||||
gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_BYTES, 0, -1, 0));
|
gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_BYTES, 0, -1, 0));
|
||||||
|
|
||||||
asfmux->file_id = gst_asf_generate_file_id ();
|
gst_asf_generate_file_id (&asfmux->file_id);
|
||||||
|
|
||||||
/* Get the metadata for content description object.
|
/* Get the metadata for content description object.
|
||||||
* We store our own taglist because it might get changed from now
|
* We store our own taglist because it might get changed from now
|
||||||
|
|
|
@ -63,18 +63,16 @@ const Guid guids[] = {
|
||||||
*
|
*
|
||||||
* Returns: The generated GUID
|
* Returns: The generated GUID
|
||||||
*/
|
*/
|
||||||
Guid
|
void
|
||||||
gst_asf_generate_file_id (void)
|
gst_asf_generate_file_id (Guid * guid)
|
||||||
{
|
{
|
||||||
guint32 aux;
|
guint32 aux;
|
||||||
Guid guid;
|
|
||||||
guid.v1 = g_random_int ();
|
|
||||||
aux = g_random_int ();
|
|
||||||
guid.v2 = (guint16) (aux & 0x0000FFFF);
|
|
||||||
guid.v3 = (guint16) (aux >> 16);
|
|
||||||
guid.v4 = (((guint64) g_random_int ()) << 32) | (guint64) g_random_int ();
|
|
||||||
|
|
||||||
return guid;
|
guid->v1 = g_random_int ();
|
||||||
|
aux = g_random_int ();
|
||||||
|
guid->v2 = (guint16) (aux & 0x0000FFFF);
|
||||||
|
guid->v3 = (guint16) (aux >> 16);
|
||||||
|
guid->v4 = (((guint64) g_random_int ()) << 32) | (guint64) g_random_int ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -83,7 +83,7 @@ typedef struct _AsfPayload
|
||||||
guint16 packet_count;
|
guint16 packet_count;
|
||||||
} AsfPayload;
|
} AsfPayload;
|
||||||
|
|
||||||
Guid gst_asf_generate_file_id (void);
|
void gst_asf_generate_file_id (Guid *guid);
|
||||||
|
|
||||||
gboolean gst_byte_reader_get_asf_var_size_field (GstByteReader * reader,
|
gboolean gst_byte_reader_get_asf_var_size_field (GstByteReader * reader,
|
||||||
guint8 field_type, guint32 * var);
|
guint8 field_type, guint32 * var);
|
||||||
|
|
|
@ -27,12 +27,6 @@
|
||||||
#include <sys/filio.h>
|
#include <sys/filio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Prototypes and definitions for private functions and not exported via gstdccp.h */
|
|
||||||
GstFlowReturn gst_dccp_socket_write (GstElement * element, int socket,
|
|
||||||
const void *buf, size_t count, int packet_size);
|
|
||||||
struct sockaddr_in gst_dccp_create_sockaddr (GstElement * element, gchar * ip,
|
|
||||||
int port);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Resolves host to IP address
|
* Resolves host to IP address
|
||||||
* @param element - the element
|
* @param element - the element
|
||||||
|
@ -339,7 +333,7 @@ gst_dccp_listen_server_socket (GstElement * element, int server_sock_fd)
|
||||||
* @param packet_size - the MTU
|
* @param packet_size - the MTU
|
||||||
* @return the number of bytes written.
|
* @return the number of bytes written.
|
||||||
*/
|
*/
|
||||||
GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_dccp_socket_write (GstElement * element, int socket, const void *buf,
|
gst_dccp_socket_write (GstElement * element, int socket, const void *buf,
|
||||||
size_t size, int packet_size)
|
size_t size, int packet_size)
|
||||||
{
|
{
|
||||||
|
@ -422,26 +416,6 @@ gst_dccp_send_buffer (GstElement * this, GstBuffer * buffer, int client_sock_fd,
|
||||||
return gst_dccp_socket_write (this, client_sock_fd, data, size, packet_size);
|
return gst_dccp_socket_write (this, client_sock_fd, data, size, packet_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Create socket address.
|
|
||||||
* @param element - the element
|
|
||||||
* @param ip - the ip address
|
|
||||||
* @param port - the port
|
|
||||||
* @return sockaddr_in.
|
|
||||||
*/
|
|
||||||
struct sockaddr_in
|
|
||||||
gst_dccp_create_sockaddr (GstElement * element, gchar * ip, int port)
|
|
||||||
{
|
|
||||||
struct sockaddr_in sin;
|
|
||||||
|
|
||||||
memset (&sin, 0, sizeof (sin));
|
|
||||||
sin.sin_family = AF_INET; /* network socket */
|
|
||||||
sin.sin_port = htons (port); /* on port */
|
|
||||||
sin.sin_addr.s_addr = inet_addr (ip); /* on host ip */
|
|
||||||
|
|
||||||
return sin;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make address reusable.
|
* Make address reusable.
|
||||||
* @param element - the element
|
* @param element - the element
|
||||||
|
|
Loading…
Reference in a new issue