diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-30 15:28:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-30 15:28:31 +0200 |
commit | 08b7d19deff96a0adae93ba7d585176036442f31 (patch) | |
tree | cf12539594204c0eeb04297a32f20e5b19c030e3 | |
parent | 1607f774949add9e93bba6f288c9c5bf2c10d880 (diff) | |
download | ffmpeg-08b7d19deff96a0adae93ba7d585176036442f31.tar.gz |
avformat/mov: Also export loci altitude
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/mov.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index a2f746b6c1..e3c2e1dee8 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -208,7 +208,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) { @@ -235,9 +235,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); |