aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2016-09-29 15:41:17 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-09-29 15:41:17 +0200
commite84eeca5779b894ea1739296e17c4361d4638de7 (patch)
treef2163b5ddfbcae1654184121916e5c39d4852c47 /libavformat
parentfcce25ee5d2f3fbe4848dee4c3d11b195d2d8126 (diff)
downloadffmpeg-e84eeca5779b894ea1739296e17c4361d4638de7.tar.gz
lavf/movenc: Put correct display aspect ratio in ARES atom.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c6
-rw-r--r--libavformat/version.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7de45804c7..8b4aa5fbe2 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1071,6 +1071,7 @@ static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
int i;
int interlaced;
int cid;
+ int display_width = track->par->width;
if (track->vos_data && track->vos_len > 0x29) {
if (ff_dnxhd_parse_header_prefix(track->vos_data) != 0) {
@@ -1122,7 +1123,10 @@ static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
ffio_wfourcc(pb, "ARES");
ffio_wfourcc(pb, "0001");
avio_wb32(pb, cid); /* dnxhd cid, some id ? */
- avio_wb32(pb, track->par->width);
+ if ( track->par->sample_aspect_ratio.num > 0
+ && track->par->sample_aspect_ratio.den > 0)
+ display_width = display_width * track->par->sample_aspect_ratio.num / track->par->sample_aspect_ratio.den;
+ avio_wb32(pb, display_width);
/* values below are based on samples created with quicktime and avid codecs */
if (interlaced) {
avio_wb32(pb, track->par->height / 2);
diff --git a/libavformat/version.h b/libavformat/version.h
index 848403e7ca..5e7448a2f0 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -33,7 +33,7 @@
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MINOR 51
-#define LIBAVFORMAT_VERSION_MICRO 101
+#define LIBAVFORMAT_VERSION_MICRO 102
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \