mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
qtdemux: handle signed values in 3GPP location tag
This commit is contained in:
parent
87e80aab57
commit
58d84a993c
2 changed files with 5 additions and 3 deletions
|
@ -6040,13 +6040,14 @@ qtdemux_tag_add_location (GstQTDemux * qtdemux, const char *tag,
|
|||
|
||||
/* +1 +1 = skip null-terminator and location role byte */
|
||||
offset += 1 + 1;
|
||||
longitude = QT_FP32 (data + offset);
|
||||
/* table in spec says unsigned, semantics say negative has meaning ... */
|
||||
longitude = QT_SFP32 (data + offset);
|
||||
|
||||
offset += 4;
|
||||
latitude = QT_FP32 (data + offset);
|
||||
latitude = QT_SFP32 (data + offset);
|
||||
|
||||
offset += 4;
|
||||
altitude = QT_FP32 (data + offset);
|
||||
altitude = QT_SFP32 (data + offset);
|
||||
|
||||
/* one invalid means all are invalid */
|
||||
if (longitude >= -180.0 && longitude <= 180.0 &&
|
||||
|
|
|
@ -38,6 +38,7 @@ typedef struct _QtNodeType QtNodeType;
|
|||
#define QT_UINT16(a) (GST_READ_UINT16_BE(a))
|
||||
#define QT_UINT8(a) (GST_READ_UINT8(a))
|
||||
#define QT_FP32(a) ((GST_READ_UINT32_BE(a))/65536.0)
|
||||
#define QT_SFP32(a) (((gint)(GST_READ_UINT32_BE(a)))/65536.0)
|
||||
#define QT_FP16(a) ((GST_READ_UINT16_BE(a))/256.0)
|
||||
#define QT_FOURCC(a) (GST_READ_UINT32_LE(a))
|
||||
#define QT_UINT64(a) ((((guint64)QT_UINT32(a))<<32)|QT_UINT32(((guint8 *)a)+4))
|
||||
|
|
Loading…
Reference in a new issue