[0.11] gst-plugins-good: wavparse: avoid using floating point unnecessarily

Sebastian Dröge slomo at kemper.freedesktop.org
Tue Jan 10 05:33:04 PST 2012


Module: gst-plugins-good
Branch: 0.11
Commit: ecec3859d838d334bda4c48bdcfd901f63b6bc2e
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=ecec3859d838d334bda4c48bdcfd901f63b6bc2e

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Tue Dec 13 11:46:43 2011 +0000

wavparse: avoid using floating point unnecessarily

https://bugzilla.gnome.org/show_bug.cgi?id=665911

---

 gst/wavparse/gstwavparse.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c
index 3ef323b..b4e5df4 100644
--- a/gst/wavparse/gstwavparse.c
+++ b/gst/wavparse/gstwavparse.c
@@ -1302,7 +1302,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
         break;
       }
       case GST_RIFF_WAVE_FORMAT_PCM:
-        if (wav->blockalign > wav->channels * (guint) ceil (wav->depth / 8.0))
+        if (wav->blockalign > wav->channels * ((wav->depth + 7) / 8))
           goto invalid_blockalign;
         /* fall through */
       default:
@@ -1686,7 +1686,7 @@ invalid_blockalign:
   {
     GST_ELEMENT_ERROR (wav, STREAM, FAILED, (NULL),
         ("Stream claims blockalign = %u, which is more than %u - invalid data",
-            wav->blockalign, wav->channels * (guint) ceil (wav->depth / 8.0)));
+            wav->blockalign, wav->channels * ((wav->depth + 7) / 8)));
     goto fail;
   }
 invalid_bps:



More information about the gstreamer-commits mailing list