0003-Floating-point-comparison-fails.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From: Mats Erik Andersson <debian@gisladisker.se>
  2. Date: Wed, 20 Jul 2011 17:24:43 +0200
  3. Subject: Floating point comparison fails.
  4. Last-Update: 2011-07-20
  5. Applied-Upstream: https://git.xiph.org/?p=vorbis-tools.git;a=commitdiff;h=3d014b1921d946bdca53d9434b8158c24dfdad8c
  6. Bug-Debian: https://bugs.debian.org/328266
  7. Bug-Debian: https://bugs.debian.org/634855
  8. In checking the quality setting, the program `oggenc'
  9. performs a floating point comparison after down scaling
  10. the given value to a tenth. This causes the inexact
  11. internal representation to complain unnecessarily.
  12. *
  13. It is better to compare first, and normalize later,
  14. since quality 10 is top notch!
  15. ---
  16. oggenc/oggenc.c | 6 +++---
  17. 1 file changed, 3 insertions(+), 3 deletions(-)
  18. diff --git a/oggenc/oggenc.c b/oggenc/oggenc.c
  19. index 9c3e9cd..5c36fea 100644
  20. --- a/oggenc/oggenc.c
  21. +++ b/oggenc/oggenc.c
  22. @@ -858,12 +858,12 @@ static void parse_options(int argc, char **argv, oe_options *opt)
  23. break;
  24. }
  25. opt->quality_set=1;
  26. - opt->quality *= 0.1;
  27. - if(opt->quality > 1.0f)
  28. + if(opt->quality > 10.0f)
  29. {
  30. - opt->quality = 1.0f;
  31. + opt->quality = 10.0f;
  32. fprintf(stderr, _("WARNING: quality setting too high, setting to maximum quality.\n"));
  33. }
  34. + opt->quality *= 0.1;
  35. break;
  36. case 'n':
  37. if(opt->namefmt)