After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 326864 - [wavparse] time to bytes format conversion broken
[wavparse] time to bytes format conversion broken
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
Other Linux
: Normal normal
: 0.10.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2006-01-13 15:55 UTC by Tommi Myöhänen
Modified: 2006-01-18 19:10 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Tommi Myöhänen 2006-01-13 15:55:49 UTC
There seems to be problems with e.g. IMA-ADPCM format when converting from GST_FORMAT_TIME to GST_FORMAT_BYTES, the dest_value gets wrong values due to blockalign.
This patch should fix the problem.

--- gstwavparse.c.orig  2005-12-28 16:04:44.000000000 +0200
+++ gstwavparse.c       2005-12-28 16:21:17.000000000 +0200
@@ -1104,8 +1104,8 @@
       switch (*dest_format) {
         case GST_FORMAT_BYTES:
           /* make sure we end up on a sample boundary */
-          *dest_value =
-              (src_value * wavparse->rate / GST_SECOND) * wavparse->blockalign;
+          *dest_value = src_value * wavparse->bps / GST_SECOND;
+          *dest_value -= *dest_value % wavparse->blockalign;
         case GST_FORMAT_DEFAULT:
           *dest_value = src_value * wavparse->rate / GST_SECOND;
Comment 1 Tim-Philipp Müller 2006-01-18 19:10:31 UTC
Fixed in CVS, thanks for the patch!

2006-01-18  Tim-Philipp Müller  <tim at centricular dot net>

        * gst/wavparse/gstwavparse.c: (gst_wavparse_pad_convert):
          Fix conversion from TIME to BYTES format (fixes #326864;
          patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>)