diff mbox series

[FFmpeg-devel,2/2] avcodec/pngenc: fix mDCv typo

Message ID 20240702134424.133688-2-leo.izen@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/2] avcodec/pngdec: fix mDCv typo | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Leo Izen July 2, 2024, 1:44 p.m. UTC
When mDCv support was added, there was a typo in both variable names
and also the MKTAG itself, incorrectly listing it as mDVc. The tag name
stands for Mastering Display Color Volume so mDCv is correct.

Typo originally introduced in 78949041417caaef0c82b2b23d7defdd88aa2378.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
---
 libavcodec/pngenc.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Leo Izen July 3, 2024, 2:25 p.m. UTC | #1
On 7/2/24 9:44 AM, Leo Izen wrote:
> When mDCv support was added, there was a typo in both variable names
> and also the MKTAG itself, incorrectly listing it as mDVc. The tag name
> stands for Mastering Display Color Volume so mDCv is correct.
> 
> Typo originally introduced in 78949041417caaef0c82b2b23d7defdd88aa2378.
> 
> Signed-off-by: Leo Izen <leo.izen@gmail.com>
> Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
> ---

Merged and backported to release/7.0 branch.
diff mbox series

Patch

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 89c3d5b83e..7ae16fa2c5 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -450,17 +450,17 @@  static int encode_headers(AVCodecContext *avctx, const AVFrame *pict)
 
     side_data = av_frame_get_side_data(pict, AV_FRAME_DATA_MASTERING_DISPLAY_METADATA);
     if (side_data) {
-        AVMasteringDisplayMetadata *mdvc = (AVMasteringDisplayMetadata *) side_data->data;
-        if (mdvc->has_luminance && mdvc->has_primaries) {
+        AVMasteringDisplayMetadata *mdcv = (AVMasteringDisplayMetadata *) side_data->data;
+        if (mdcv->has_luminance && mdcv->has_primaries) {
             for (int i = 0; i < 3; i++) {
-                AV_WB16(s->buf + 2*i, PNG_Q2D(mdvc->display_primaries[i][0], 50000));
-                AV_WB16(s->buf + 2*i + 2, PNG_Q2D(mdvc->display_primaries[i][1], 50000));
+                AV_WB16(s->buf + 2*i, PNG_Q2D(mdcv->display_primaries[i][0], 50000));
+                AV_WB16(s->buf + 2*i + 2, PNG_Q2D(mdcv->display_primaries[i][1], 50000));
             }
-            AV_WB16(s->buf + 12, PNG_Q2D(mdvc->white_point[0], 50000));
-            AV_WB16(s->buf + 14, PNG_Q2D(mdvc->white_point[1], 50000));
-            AV_WB32(s->buf + 16, PNG_Q2D(mdvc->max_luminance, 10000));
-            AV_WB32(s->buf + 20, PNG_Q2D(mdvc->min_luminance, 10000));
-            png_write_chunk(&s->bytestream, MKTAG('m', 'D', 'V', 'c'), s->buf, 24);
+            AV_WB16(s->buf + 12, PNG_Q2D(mdcv->white_point[0], 50000));
+            AV_WB16(s->buf + 14, PNG_Q2D(mdcv->white_point[1], 50000));
+            AV_WB32(s->buf + 16, PNG_Q2D(mdcv->max_luminance, 10000));
+            AV_WB32(s->buf + 20, PNG_Q2D(mdcv->min_luminance, 10000));
+            png_write_chunk(&s->bytestream, MKTAG('m', 'D', 'C', 'v'), s->buf, 24);
         }
     }