aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorGyan Doshi <ffmpeg@gyani.pro>2023-03-26 12:40:09 +0530
committerGyan Doshi <ffmpeg@gyani.pro>2023-04-03 15:00:16 +0530
commit6941788d24ea350498ecb327e03d625974e55d9f (patch)
treee3673df168d5a29b7c1d090e529be3b40f3da4da /libavformat/movenc.c
parentc6dedaf491c7cfd44130cc4411b650b5b837a8a1 (diff)
downloadffmpeg-6941788d24ea350498ecb327e03d625974e55d9f.tar.gz
avformat/movenc: correct loci parameter handling
3GPP TS 26.244 Table 8.10 specifies that longitude is written before latitude. The MOV demuxer already expects the correct order. So, write them in that order. However, the user supplied string may also be used in MOV mode which requires ISO 6709 format which specifies latitude first. The demuxer also exports the loci value in that format. So parser adjusted as well.
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 68e7f8222b..c370922c7d 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4021,13 +4021,13 @@ static int mov_write_loci_tag(AVFormatContext *s, AVIOContext *pb)
return 0;
ptr = t->value;
- longitude = strtod(ptr, &end);
+ latitude = strtod(ptr, &end);
if (end == ptr) {
av_log(s, AV_LOG_WARNING, "malformed location metadata\n");
return 0;
}
ptr = end;
- latitude = strtod(ptr, &end);
+ longitude = strtod(ptr, &end);
if (end == ptr) {
av_log(s, AV_LOG_WARNING, "malformed location metadata\n");
return 0;
@@ -4048,8 +4048,8 @@ static int mov_write_loci_tag(AVFormatContext *s, AVIOContext *pb)
avio_wb16(pb, lang);
avio_write(pb, place, strlen(place) + 1);
avio_w8(pb, 0); /* role of place (0 == shooting location, 1 == real location, 2 == fictional location) */
- avio_wb32(pb, latitude_fix);
avio_wb32(pb, longitude_fix);
+ avio_wb32(pb, latitude_fix);
avio_wb32(pb, altitude_fix);
avio_write(pb, astronomical_body, strlen(astronomical_body) + 1);
avio_w8(pb, 0); /* additional notes, null terminated string */