mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
ext/speex/gstspeexenc.c: Signedness cleanups.
Original commit message from CVS: 2005-10-11 Andy Wingo <wingo@pobox.com> * ext/speex/gstspeexenc.c: Signedness cleanups.
This commit is contained in:
parent
ddecb1d34a
commit
d9100aa5d0
4 changed files with 16 additions and 14 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2005-10-11 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* ext/speex/gstspeexenc.c: Signedness cleanups.
|
||||||
|
|
||||||
2005-10-10 Edgard Lima <edgard.lima@indt.org.br>
|
2005-10-10 Edgard Lima <edgard.lima@indt.org.br>
|
||||||
|
|
||||||
* PORTED_09:
|
* PORTED_09:
|
||||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit eb0dd118a086dd4aa405d3871131839d81306245
|
Subproject commit 221ccc0dc85b2d38bc5e2fc3f21cd80971777791
|
|
@ -584,36 +584,34 @@ gst_speexenc_get_tag_value (const GstTagList * list, const gchar * tag,
|
||||||
}while(0)
|
}while(0)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
comment_init (char **comments, int *length, char *vendor_string)
|
comment_init (guint8 ** comments, int *length, char *vendor_string)
|
||||||
{
|
{
|
||||||
int vendor_length = strlen (vendor_string);
|
int vendor_length = strlen (vendor_string);
|
||||||
int user_comment_list_length = 0;
|
int user_comment_list_length = 0;
|
||||||
int len = 4 + vendor_length + 4;
|
int len = 4 + vendor_length + 4;
|
||||||
char *p = (char *) malloc (len);
|
guint8 *p = g_malloc (len);
|
||||||
|
|
||||||
if (p == NULL) {
|
|
||||||
}
|
|
||||||
writeint (p, 0, vendor_length);
|
writeint (p, 0, vendor_length);
|
||||||
memcpy (p + 4, vendor_string, vendor_length);
|
memcpy (p + 4, (guint8 *) vendor_string, vendor_length);
|
||||||
writeint (p, 4 + vendor_length, user_comment_list_length);
|
writeint (p, 4 + vendor_length, user_comment_list_length);
|
||||||
*length = len;
|
*length = len;
|
||||||
*comments = p;
|
*comments = p;
|
||||||
}
|
}
|
||||||
static void
|
static void
|
||||||
comment_add (char **comments, int *length, const char *tag, char *val)
|
comment_add (guint8 ** comments, int *length, const char *tag, char *val)
|
||||||
{
|
{
|
||||||
char *p = *comments;
|
guint8 *p = *comments;
|
||||||
int vendor_length = readint (p, 0);
|
int vendor_length = readint (p, 0);
|
||||||
int user_comment_list_length = readint (p, 4 + vendor_length);
|
int user_comment_list_length = readint (p, 4 + vendor_length);
|
||||||
int tag_len = (tag ? strlen (tag) : 0);
|
int tag_len = (tag ? strlen (tag) : 0);
|
||||||
int val_len = strlen (val);
|
int val_len = strlen (val);
|
||||||
int len = (*length) + 4 + tag_len + val_len;
|
int len = (*length) + 4 + tag_len + val_len;
|
||||||
|
|
||||||
p = (char *) realloc (p, len);
|
p = g_realloc (p, len);
|
||||||
|
|
||||||
writeint (p, *length, tag_len + val_len); /* length of comment */
|
writeint (p, *length, tag_len + val_len); /* length of comment */
|
||||||
if (tag)
|
if (tag)
|
||||||
memcpy (p + *length + 4, tag, tag_len); /* comment */
|
memcpy (p + *length + 4, (guint8 *) tag, tag_len); /* comment */
|
||||||
memcpy (p + *length + 4 + tag_len, val, val_len); /* comment */
|
memcpy (p + *length + 4 + tag_len, val, val_len); /* comment */
|
||||||
writeint (p, 4 + vendor_length, user_comment_list_length + 1);
|
writeint (p, 4 + vendor_length, user_comment_list_length + 1);
|
||||||
|
|
||||||
|
@ -921,7 +919,7 @@ gst_speexenc_chain (GstPad * pad, GstBuffer * buf)
|
||||||
gst_speexenc_set_metadata (speexenc);
|
gst_speexenc_set_metadata (speexenc);
|
||||||
|
|
||||||
/* create header buffer */
|
/* create header buffer */
|
||||||
data = speex_header_to_packet (&speexenc->header, &data_len);
|
data = (guint8 *) speex_header_to_packet (&speexenc->header, &data_len);
|
||||||
buf1 = gst_speexenc_buffer_from_data (speexenc, data, data_len, 0);
|
buf1 = gst_speexenc_buffer_from_data (speexenc, data, data_len, 0);
|
||||||
|
|
||||||
/* create comment buffer */
|
/* create comment buffer */
|
||||||
|
@ -989,8 +987,8 @@ gst_speexenc_chain (GstPad * pad, GstBuffer * buf)
|
||||||
GST_BUFFER_OFFSET_NONE, outsize, GST_PAD_CAPS (speexenc->srcpad),
|
GST_BUFFER_OFFSET_NONE, outsize, GST_PAD_CAPS (speexenc->srcpad),
|
||||||
&outbuf);
|
&outbuf);
|
||||||
|
|
||||||
written =
|
written = speex_bits_write (&speexenc->bits,
|
||||||
speex_bits_write (&speexenc->bits, GST_BUFFER_DATA (outbuf), outsize);
|
(gchar *) GST_BUFFER_DATA (outbuf), outsize);
|
||||||
g_assert (written == outsize);
|
g_assert (written == outsize);
|
||||||
speex_bits_reset (&speexenc->bits);
|
speex_bits_reset (&speexenc->bits);
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ struct _GstSpeexEnc {
|
||||||
gint frame_size;
|
gint frame_size;
|
||||||
guint64 frameno;
|
guint64 frameno;
|
||||||
|
|
||||||
gchar *comments;
|
guint8 *comments;
|
||||||
gint comment_len;
|
gint comment_len;
|
||||||
|
|
||||||
gfloat input[MAX_FRAME_SIZE];
|
gfloat input[MAX_FRAME_SIZE];
|
||||||
|
|
Loading…
Reference in a new issue