diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2008-11-20 20:07:26 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-11-20 20:07:26 +0000 |
commit | 380b64d670d1a8a9a5075d3a235f57f10d0f41fa (patch) | |
tree | 350a2752ed5f08da9c0eace8717de3b511978709 /gst | |
parent | fe7d1d7ae0ffabbd19ace6900e1dd9b83e22e95c (diff) |
gst/wavparse/gstwavparse.c: Fix the scaling code.
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (uint64_ceiling_scale_int),
(uint64_ceiling_scale), (gst_wavparse_calculate_duration),
(gst_wavparse_stream_headers):
Fix the scaling code.
Fix parsing of the INFO chunks, we were reading the wrong number of
bytes. Fixes #561580.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/wavparse/gstwavparse.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 8f87c2d5..7cbb4d3b 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -248,7 +248,7 @@ gst_wavparse_create_sourcepad (GstWavParse * wavparse) static guint64 uint64_ceiling_scale_int (guint64 val, gint num, gint denom) { - guint64 result = gst_util_uint64_scale (val, num, denom); + guint64 result = gst_util_uint64_scale_int (val, num, denom); if (uint64_scale_modulo (val, num, denom) == 0) return result; @@ -260,7 +260,7 @@ uint64_ceiling_scale_int (guint64 val, gint num, gint denom) static guint64 uint64_ceiling_scale (guint64 val, guint64 num, guint64 denom) { - guint64 result = gst_util_uint64_scale_int (val, num, denom); + guint64 result = gst_util_uint64_scale (val, num, denom); if (uint64_scale_modulo (val, num, denom) == 0) return result; @@ -1046,6 +1046,7 @@ gst_wavparse_calculate_duration (GstWavParse * wav) return TRUE; if (wav->bps > 0) { + GST_INFO_OBJECT (wav, "Got datasize %" G_GUINT64_FORMAT, wav->datasize); wav->duration = uint64_ceiling_scale (wav->datasize, GST_SECOND, (guint64) wav->bps); GST_INFO_OBJECT (wav, "Got duration (bps) %" GST_TIME_FORMAT, @@ -1371,7 +1372,7 @@ gst_wavparse_stream_headers (GstWavParse * wav) } switch (ltag) { case GST_RIFF_LIST_INFO:{ - const guint data_size = size - 12; + const guint data_size = size - 4; GstTagList *new; GST_INFO_OBJECT (wav, "Have LIST chunk INFO"); |