[vlc-devel] [PATCH] input/es_out: EsOutUpdateInfo: remove redundant cast + variable

Filip Roséen filip at atch.se
Tue May 23 00:14:00 CEST 2017


There is no need for an explicitly declared variable as it is only
being read from once, furthermore the cast to float is redundant as
the operand will implicitly be promoted to float prior to calculating
the expression.
---
 src/input/es_out.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 19fec0ef5b..4d75178902 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -3190,17 +3190,13 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
        }
        if ( fmt->video.mastering.max_luminance )
        {
-           float luminance = (float)fmt->video.mastering.max_luminance /
-                                    10000.f;
            info_category_AddInfo( p_cat, _("Max luminance"), "%.4f cd/m²",
-                                  luminance );
+               fmt->video.mastering.max_luminance / 10000.f );
        }
        if ( fmt->video.mastering.min_luminance )
        {
-           float luminance = (float)fmt->video.mastering.min_luminance /
-                                    10000.f;
            info_category_AddInfo( p_cat, _("Min luminance"), "%.4f cd/m²",
-                                  luminance );
+               fmt->video.mastering.min_luminance / 10000.f );
        }
        if ( fmt->video.mastering.primaries[4] &&
             fmt->video.mastering.primaries[5] )
-- 
2.13.0


More information about the vlc-devel mailing list