added adder duration fix

This commit is contained in:
maroy 2005-06-29 12:45:50 +00:00
parent c870f91164
commit db98ec9913
2 changed files with 32 additions and 1 deletions

View file

@ -22,7 +22,7 @@
# #
# #
# Author : $Author: maroy $ # Author : $Author: maroy $
# Version : $Revision: 1.5 $ # Version : $Revision: 1.6 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/tools/gstreamer/gstreamer-0.8.10/bin/Attic/install.sh,v $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/tools/gstreamer/gstreamer-0.8.10/bin/Attic/install.sh,v $
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -65,6 +65,8 @@ cd ${plugins}
# see bug report at http://bugzilla.gnome.org/show_bug.cgi?id=305658 # see bug report at http://bugzilla.gnome.org/show_bug.cgi?id=305658
# for details on the following patch # for details on the following patch
patch -p1 < ${etcdir}/adder-fix.diff patch -p1 < ${etcdir}/adder-fix.diff
# TODO: file a bug report with this patch
patch -p1 < ${etcdir}/adder-duration-fix.patch
# see bug report at http://bugzilla.gnome.org/show_bug.cgi?id=308167 # see bug report at http://bugzilla.gnome.org/show_bug.cgi?id=308167
# for details on the following patch # for details on the following patch
patch -p1 < ${etcdir}/switch-fix.diff patch -p1 < ${etcdir}/switch-fix.diff

View file

@ -0,0 +1,29 @@
--- gst-plugins-0.8.9/gst/adder/gstadder.c 2005-06-29 14:45:17.000000000 +0200
+++ gst-plugins-0.8.9-livesupport/gst/adder/gstadder.c 2005-06-29 14:42:05.000000000 +0200
@@ -558,14 +558,19 @@
}
if (valid_inputs > 0 || adder->eos == FALSE) {
+ gint64 delta;
+ gint64 duration;
+
+ delta = (adder->format == GST_ADDER_FORMAT_FLOAT)
+ ? GST_BUFFER_SIZE (buf_out) / adder->width / adder->channels
+ : GST_BUFFER_SIZE (buf_out) * 8 / adder->width / adder->channels;
+ duration = delta * GST_SECOND / adder->rate;
+
GST_BUFFER_TIMESTAMP (buf_out) = adder->timestamp;
- if (adder->format == GST_ADDER_FORMAT_FLOAT)
- adder->offset +=
- GST_BUFFER_SIZE (buf_out) / adder->width / adder->channels;
- else
- adder->offset +=
- GST_BUFFER_SIZE (buf_out) * 8 / adder->width / adder->channels;
- adder->timestamp = adder->offset * GST_SECOND / adder->rate;
+ GST_BUFFER_DURATION (buf_out) = duration;
+
+ adder->offset += delta;
+ adder->timestamp += duration;
/* send it out */
GST_LOG ("pushing buf_out");