[vlc-commits] es_out: respect user locale in frame rate
Rémi Denis-Courmont
git at videolan.org
Fri Mar 9 22:58:19 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Mar 9 23:48:05 2018 +0200| [921dcd7fbce264d509b56fdc661855edb2e7fc3f] | committer: Rémi Denis-Courmont
es_out: respect user locale in frame rate
Not everybody uses dot as the decimal separator.
This reverts commit cf716aa8deaffeb3e038c6c9ee72ed8d80577d78.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=921dcd7fbce264d509b56fdc661855edb2e7fc3f
---
src/input/es_out.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/input/es_out.c b/src/input/es_out.c
index af4979edd2..db465feca8 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -3031,7 +3031,6 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
es_out_sys_t *p_sys = out->p_sys;
input_thread_t *p_input = p_sys->p_input;
const es_format_t *p_fmt_es = &es->fmt;
- lldiv_t div;
if( es->fmt.i_cat == fmt->i_cat )
{
@@ -3163,15 +3162,13 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
if( fmt->video.i_frame_rate > 0 &&
fmt->video.i_frame_rate_base > 0 )
{
- div = lldiv( (float)fmt->video.i_frame_rate /
- fmt->video.i_frame_rate_base * 1000000,
- 1000000 );
- if( div.rem > 0 )
- info_category_AddInfo( p_cat, _("Frame rate"), "%"PRId64".%06u",
- div.quot, (unsigned int )div.rem );
+ if( fmt->video.i_frame_rate_base == 1 )
+ info_category_AddInfo( p_cat, _("Frame rate"), "%u",
+ fmt->video.i_frame_rate );
else
- info_category_AddInfo( p_cat, _("Frame rate"), "%"PRId64,
- div.quot );
+ info_category_AddInfo( p_cat, _("Frame rate"), "%.6f",
+ (double)fmt->video.i_frame_rate
+ / (double)fmt->video.i_frame_rate_base );
}
if( fmt->i_codec != p_fmt_es->i_codec )
{
More information about the vlc-commits
mailing list