summaryrefslogtreecommitdiffstats
path: root/ext/pulse/pulsesink.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-04-16 22:50:59 +0200
committerWim Taymans <wim@metal.(none)>2009-04-16 22:51:54 +0200
commitc052906590e8a2a76f6311e8c194bb6dbe350d7f (patch)
tree99907c0c9fda388b0bfd239dd2193846784d96a1 /ext/pulse/pulsesink.c
parentcdeb8ebb133ab81e385c9bb98973209dad374479 (diff)
pulsesink: fix sample offset calculation again
Diffstat (limited to 'ext/pulse/pulsesink.c')
-rw-r--r--ext/pulse/pulsesink.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
index 8f8805f6..23b69be6 100644
--- a/ext/pulse/pulsesink.c
+++ b/ext/pulse/pulsesink.c
@@ -999,7 +999,8 @@ gst_pulseringbuffer_commit (GstRingBuffer * buf, guint64 * sample,
else
offset = 0;
}
- offset = *sample * bps;
+ /* offset is in bytes */
+ offset *= bps;
while (*toprocess > 0) {
size_t avail;
@@ -1088,7 +1089,7 @@ gst_pulseringbuffer_commit (GstRingBuffer * buf, guint64 * sample,
avail = towrite / bps;
}
*sample += avail;
- offset = *sample * bps;
+ offset += avail * bps;
/* check if we need to uncork after writing the samples */
if (pbuf->corked) {