summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-30 15:28:31 +0200
committerMartin Storsjö <martin@martin.st>2016-05-19 10:46:53 +0300
commitbc43131997a456ecdff160eab288395f5adb8d72 (patch)
tree241fe18deedd398eb9734f44e5e66984a7c4f3c2
parent94d8141c8cd96c176f7d4bdb74a95331ec7db19b (diff)
mov: Also export loci altitude
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavformat/mov.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b15e29037b..125919fa57 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -223,7 +223,7 @@ static int mov_metadata_loci(MOVContext *c, AVIOContext *pb, unsigned len)
char language[4] = { 0 };
char buf[200], place[100];
uint16_t langcode = 0;
- double longitude, latitude;
+ double longitude, latitude, altitude;
const char *key = "location";
if (len < 4 + 2 + 1 + 1 + 4 + 4 + 4) {
@@ -251,9 +251,14 @@ static int mov_metadata_loci(MOVContext *c, AVIOContext *pb, unsigned len)
}
longitude = ((int32_t) avio_rb32(pb)) / (float) (1 << 16);
latitude = ((int32_t) avio_rb32(pb)) / (float) (1 << 16);
+ altitude = ((int32_t) avio_rb32(pb)) / (float) (1 << 16);
// Try to output in the same format as the ?xyz field
- snprintf(buf, sizeof(buf), "%+08.4f%+09.4f/%s", latitude, longitude, place);
+ snprintf(buf, sizeof(buf), "%+08.4f%+09.4f", latitude, longitude);
+ if (altitude)
+ av_strlcatf(buf, sizeof(buf), "%+f", altitude);
+ av_strlcatf(buf, sizeof(buf), "/%s", place);
+
if (*language && strcmp(language, "und")) {
char key2[16];
snprintf(key2, sizeof(key2), "%s-%s", key, language);