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

Filip Roséen git at videolan.org
Sat Jun 3 14:17:40 CEST 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Tue May 23 00:14:00 2017 +0200| [780950943991764e58e8faa49b1e5ae6e732442e] | committer: Jean-Baptiste Kempf

input/es_out: EsOutUpdateInfo: remove redundant cast + variable

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.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=780950943991764e58e8faa49b1e5ae6e732442e
---

 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] )



More information about the vlc-commits mailing list