aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-12-21 01:23:17 -0300
committerJames Almer <jamrial@gmail.com>2017-12-21 01:23:17 -0300
commitbc10260f49d594b552926b5f81e0282dfdebc503 (patch)
tree46dcb8865a33839472011abb4014363fc33f1b74
parent22ae33fb4083c75f7b817211e28c467cbcd72a00 (diff)
downloadffmpeg-bc10260f49d594b552926b5f81e0282dfdebc503.tar.gz
avformat/mov: simplify parsing of mdcv atom using av_make_q()
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/mov.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 480e506370..20644734dc 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5210,20 +5210,14 @@ static int mov_read_mdcv(MOVContext *c, AVIOContext *pb, MOVAtom atom)
for (i = 0; i < 3; i++) {
const int j = mapping[i];
- sc->mastering->display_primaries[j][0].num = avio_rb16(pb);
- sc->mastering->display_primaries[j][0].den = chroma_den;
- sc->mastering->display_primaries[j][1].num = avio_rb16(pb);
- sc->mastering->display_primaries[j][1].den = chroma_den;
- }
- sc->mastering->white_point[0].num = avio_rb16(pb);
- sc->mastering->white_point[0].den = chroma_den;
- sc->mastering->white_point[1].num = avio_rb16(pb);
- sc->mastering->white_point[1].den = chroma_den;
-
- sc->mastering->max_luminance.num = avio_rb32(pb);
- sc->mastering->max_luminance.den = luma_den;
- sc->mastering->min_luminance.num = avio_rb32(pb);
- sc->mastering->min_luminance.den = luma_den;
+ sc->mastering->display_primaries[j][0] = av_make_q(avio_rb16(pb), chroma_den);
+ sc->mastering->display_primaries[j][1] = av_make_q(avio_rb16(pb), chroma_den);
+ }
+ sc->mastering->white_point[0] = av_make_q(avio_rb16(pb), chroma_den);
+ sc->mastering->white_point[1] = av_make_q(avio_rb16(pb), chroma_den);
+
+ sc->mastering->max_luminance = av_make_q(avio_rb32(pb), luma_den);
+ sc->mastering->min_luminance = av_make_q(avio_rb32(pb), luma_den);
sc->mastering->has_luminance = 1;
sc->mastering->has_primaries = 1;