[gstreamer-plugins-good/f15] Backport patch to correct flacdec sample number rounding. (#722667)

Brian Pepple bpepple at fedoraproject.org
Mon Nov 28 00:09:48 UTC 2011


commit 74b1fba82ddc3d6870aa3e8f081befe70904b3c0
Author: Brian Pepple <bpepple at fedoraproject.org>
Date:   Sun Nov 27 19:09:29 2011 -0500

    Backport patch to correct flacdec sample number rounding. (#722667)

 ...30-flacdec_correct_sample_number_rounding.patch |   24 ++++++++++++++++++++
 gstreamer-plugins-good.spec                        |    7 +++++-
 2 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/gstreamer-plugins-good-0.10.30-flacdec_correct_sample_number_rounding.patch b/gstreamer-plugins-good-0.10.30-flacdec_correct_sample_number_rounding.patch
new file mode 100644
index 0000000..dac7147
--- /dev/null
+++ b/gstreamer-plugins-good-0.10.30-flacdec_correct_sample_number_rounding.patch
@@ -0,0 +1,24 @@
+From 799c8e3d04456ce0b22c03de66d20d0a1a599643 Mon Sep 17 00:00:00 2001
+From: Monty Montgomery <cmontgom at redhat.com>
+Date: Thu, 21 Jul 2011 21:23:28 +0000
+Subject: flacdec: Correct sample number rounding resulting in timestamp jitter
+
+flacdec converts the src timestamp to a sample number, uses that internally, then reconverts the sample number to a timestamp for the output buffer.  Unfortunately, sample numbers can't be represented in an integer number of nanoseconds, and the conversion process was truncating rather than rounding, resulting in sample numbers and output timestamps that were often off by a full sample.
+
+This corrects the time->sample convesion
+---
+diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c
+index 061fa81..1e2ef5e 100644
+--- a/ext/flac/gstflacdec.c
++++ b/ext/flac/gstflacdec.c
+@@ -1668,7 +1668,7 @@ gst_flac_dec_convert_src (GstPad * pad, GstFormat src_format, gint64 src_value,
+         case GST_FORMAT_BYTES:
+           scale = bytes_per_sample;
+         case GST_FORMAT_DEFAULT:
+-          *dest_value = gst_util_uint64_scale_int (src_value,
++          *dest_value = gst_util_uint64_scale_int_round (src_value,
+               scale * flacdec->sample_rate, GST_SECOND);
+           break;
+         default:
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/gstreamer-plugins-good.spec b/gstreamer-plugins-good.spec
index 391e33b..cc36e56 100644
--- a/gstreamer-plugins-good.spec
+++ b/gstreamer-plugins-good.spec
@@ -6,7 +6,7 @@
 
 Name:           %{gstreamer}-plugins-good
 Version:        0.10.29
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        GStreamer plug-ins with good code and licensing
 
 Group:          Applications/Multimedia
@@ -14,6 +14,7 @@ License:        LGPLv2+
 URL:            http://gstreamer.freedesktop.org/
 #Source:         http://gstreamer.freedesktop.org/src/gst-plugins-good/pre/gst-plugins-good-%{version}.tar.bz2
 Source:         http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-%{version}.tar.bz2
+Patch0:         gstreamer-plugins-good-0.10.30-flacdec_correct_sample_number_rounding.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires:       %{gstreamer} >= %{_gst}
@@ -103,6 +104,7 @@ This package contains documentation for the provided plugins.
 
 %prep
 %setup -q -n gst-plugins-good-%{version}
+%patch0 -p1 
 
 %build
 
@@ -244,6 +246,9 @@ export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/gstreamer-%{majorminor}.schemas > /dev/null || :
 
 %changelog
+* Sun Nov 27 2011 Brian Pepple <bpepple at fedoraproject.org> - 0.10.29-2
+- Backport patch to correct flacdec sample number rounding. (#722667)
+
 * Fri May 13 2011 Benjamin Otte <otte at redhat.com> 0.10.29-1
 - Update to 0.10.29
 


More information about the scm-commits mailing list