qtmux: Fix signed floating point values writing

You would end up on some architectures with 0 being written out
instead of the proper value.

https://bugzilla.gnome.org/show_bug.cgi?id=649449
This commit is contained in:
Edward Hervey 2011-05-05 13:24:23 +02:00
parent fc94b78fe1
commit cca48a42c6

View file

@ -769,9 +769,10 @@ gst_qt_mux_add_3gp_location (GstQTMux * qtmux, const GstTagList * list,
/* role */
GST_WRITE_UINT8 (data, 0);
/* long, lat, alt */
GST_WRITE_UINT32_BE (data + 1, (guint32) (longitude * 65536.0));
GST_WRITE_UINT32_BE (data + 5, (guint32) (latitude * 65536.0));
GST_WRITE_UINT32_BE (data + 9, (guint32) (altitude * 65536.0));
#define QT_WRITE_SFP32(data, fp) GST_WRITE_UINT32_BE(data, (guint32) ((gint) (fp * 65536.0)))
QT_WRITE_SFP32 (data + 1, longitude);
QT_WRITE_SFP32 (data + 5, latitude);
QT_WRITE_SFP32 (data + 9, altitude);
/* neither astronomical body nor notes */
GST_WRITE_UINT16_BE (data + 13, 0);