From cca48a42c69d69dcb86ec5ab4c3fd98c9b670731 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 5 May 2011 13:24:23 +0200 Subject: [PATCH] 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 --- gst/isomp4/gstqtmux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index 0b52e500f5..530c61199c 100644 --- a/gst/isomp4/gstqtmux.c +++ b/gst/isomp4/gstqtmux.c @@ -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);