summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMark Boorer <markboo99@gmail.com>2014-07-08 22:09:57 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-07-09 00:35:23 +0200
commit352756ecae8f8868ff756ad3da098c29ce2276f1 (patch)
tree26a21c0109562832a735bcd69d8beddc988bd212 /libavformat
parent7125b6ca90d4085832a0fa7e37f684181eb89094 (diff)
avformat/movenc: respect color_range when encoding dnxhd.
Set the ACLR atom appropriately for legal / full range. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 919ae58ca0..7e737b0f07 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -807,7 +807,11 @@ static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
ffio_wfourcc(pb, "ACLR");
ffio_wfourcc(pb, "ACLR");
ffio_wfourcc(pb, "0001");
- avio_wb32(pb, 2); /* yuv range: full 1 / normal 2 */
+ if (track->enc->color_range == AVCOL_RANGE_MPEG) { /* Legal range (16-235) */
+ avio_wb32(pb, 1); /* Corresponds to 709 in official encoder */
+ } else { /* Full range (0-255) */
+ avio_wb32(pb, 2); /* Corresponds to RGB in official encoder */
+ }
avio_wb32(pb, 0); /* unknown */
avio_wb32(pb, 24); /* size */