Fix a bunch of endianness conversions that were done as long instead of int32. Should go into 0.6.1.
Original commit message from CVS: Fix a bunch of endianness conversions that were done as long instead of int32. Should go into 0.6.1.
This commit is contained in:
parent
a1fa51068b
commit
af874cb250
@ -144,7 +144,7 @@ GST_PAD_TEMPLATE_FACTORY ( audio_src_temp,
|
|||||||
static GstCaps*
|
static GstCaps*
|
||||||
dv_type_find (GstBuffer *buf, gpointer private)
|
dv_type_find (GstBuffer *buf, gpointer private)
|
||||||
{
|
{
|
||||||
gulong head = GULONG_FROM_BE(*((gulong *)GST_BUFFER_DATA(buf)));
|
guint32 head = GUINT32_FROM_BE(*((guint32 *)GST_BUFFER_DATA(buf)));
|
||||||
GstCaps *new = NULL;
|
GstCaps *new = NULL;
|
||||||
|
|
||||||
/* check for DIF and DV flag */
|
/* check for DIF and DV flag */
|
||||||
|
@ -70,7 +70,7 @@ static GstTypeDefinition flacdefinition = {
|
|||||||
static GstCaps*
|
static GstCaps*
|
||||||
flac_type_find (GstBuffer *buf, gpointer private)
|
flac_type_find (GstBuffer *buf, gpointer private)
|
||||||
{
|
{
|
||||||
gulong head = GULONG_FROM_BE (*((gulong *)GST_BUFFER_DATA (buf)));
|
guint32 head = GUINT32_FROM_BE (*((guint32 *)GST_BUFFER_DATA (buf)));
|
||||||
|
|
||||||
if (head != 0x664C6143)
|
if (head != 0x664C6143)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -191,37 +191,37 @@ gst_auparse_chain (GstPad *pad, GstBuffer *buf)
|
|||||||
/* if we haven't seen any data yet... */
|
/* if we haven't seen any data yet... */
|
||||||
if (auparse->size == 0) {
|
if (auparse->size == 0) {
|
||||||
GstBuffer *newbuf;
|
GstBuffer *newbuf;
|
||||||
gulong *head = (gulong *)data;
|
guint32 *head = (guint32 *)data;
|
||||||
|
|
||||||
/* normal format is big endian (au is a Sparc format) */
|
/* normal format is big endian (au is a Sparc format) */
|
||||||
if (GULONG_FROM_BE (*head) == 0x2e736e64) {
|
if (GUINT32_FROM_BE (*head) == 0x2e736e64) {
|
||||||
head++;
|
head++;
|
||||||
auparse->le = 0;
|
auparse->le = 0;
|
||||||
auparse->offset = GULONG_FROM_BE (*head);
|
auparse->offset = GUINT32_FROM_BE (*head);
|
||||||
head++;
|
head++;
|
||||||
auparse->size = GULONG_FROM_BE (*head);
|
auparse->size = GUINT32_FROM_BE (*head);
|
||||||
head++;
|
head++;
|
||||||
auparse->encoding = GULONG_FROM_BE (*head);
|
auparse->encoding = GUINT32_FROM_BE (*head);
|
||||||
head++;
|
head++;
|
||||||
auparse->frequency = GULONG_FROM_BE (*head);
|
auparse->frequency = GUINT32_FROM_BE (*head);
|
||||||
head++;
|
head++;
|
||||||
auparse->channels = GULONG_FROM_BE (*head);
|
auparse->channels = GUINT32_FROM_BE (*head);
|
||||||
head++;
|
head++;
|
||||||
|
|
||||||
/* but I wouldn't be surprised by a little endian version */
|
/* but I wouldn't be surprised by a little endian version */
|
||||||
} else if (GULONG_FROM_LE (head) == 0x2e736e64) {
|
} else if (GUINT32_FROM_LE (head) == 0x2e736e64) {
|
||||||
auparse->le = 1;
|
auparse->le = 1;
|
||||||
head++;
|
head++;
|
||||||
auparse->le = 0;
|
auparse->le = 0;
|
||||||
auparse->offset = GULONG_FROM_LE (*head);
|
auparse->offset = GUINT32_FROM_LE (*head);
|
||||||
head++;
|
head++;
|
||||||
auparse->size = GULONG_FROM_LE (*head);
|
auparse->size = GUINT32_FROM_LE (*head);
|
||||||
head++;
|
head++;
|
||||||
auparse->encoding = GULONG_FROM_LE (*head);
|
auparse->encoding = GUINT32_FROM_LE (*head);
|
||||||
head++;
|
head++;
|
||||||
auparse->frequency = GULONG_FROM_LE (*head);
|
auparse->frequency = GUINT32_FROM_LE (*head);
|
||||||
head++;
|
head++;
|
||||||
auparse->channels = GULONG_FROM_LE (*head);
|
auparse->channels = GUINT32_FROM_LE (*head);
|
||||||
head++;
|
head++;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user