Commit bc431319 authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Martin Storsjö

mov: Also export loci altitude

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 94d8141c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment