gst/mpegaudioparse/gstxingmux.c: Correctly write the size in bytes on big endian systems.

Original commit message from CVS:
* gst/mpegaudioparse/gstxingmux.c: (generate_xing_header):
Correctly write the size in bytes on big endian systems.
Fixes bug #515725.
This commit is contained in:
Sebastian Dröge 2008-02-11 13:29:07 +00:00
parent cfcd418583
commit 17a6a7417c
2 changed files with 19 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2008-02-11 Sebastian Dröge <slomo@circular-chaos.org>
* gst/mpegaudioparse/gstxingmux.c: (generate_xing_header):
Correctly write the size in bytes on big endian systems.
Fixes bug #515725.
2008-02-11 Sebastian Dröge <slomo@circular-chaos.org>
* ext/lame/gstlame.c: (gst_lame_setup):

View file

@ -330,12 +330,19 @@ generate_xing_header (GstXingMux * xing)
}
if (byte_count != 0) {
GST_DEBUG ("Setting number of bytes to %u", byte_count);
byte_count = GUINT32_TO_BE (byte_count);
memcpy (data, &byte_count, 4);
*xing_flags |= GST_XING_BYTES_FIELD;
data += 4;
byte_count = GUINT32_FROM_BE (byte_count);
guint32 nbytes;
if (byte_count > G_MAXUINT32) {
GST_DEBUG ("Too large stream: %" G_GINT64_FORMAT " > %" G_GINT64_FORMAT
" bytes", byte_count, G_MAXUINT32);
} else {
nbytes = byte_count;
GST_DEBUG ("Setting number of bytes to %u", nbytes);
nbytes = GUINT32_TO_BE (nbytes);
memcpy (data, &nbytes, 4);
*xing_flags |= GST_XING_BYTES_FIELD;
data += 4;
}
}
if (xing->seek_table != NULL && byte_count != 0