From 25a10db2e2f9894c9b566a57c41a0fef32c7348e Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 24 Oct 2004 14:04:38 +0000 Subject: sys/oss/gstosssrc.c: Don't mix bytes and samples. Original commit message from CVS: * sys/oss/gstosssrc.c: (gst_osssrc_get): Don't mix bytes and samples. --- ChangeLog | 5 +++++ sys/oss/gstosssrc.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd3e4707..b02fcfc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-10-24 Ronald S. Bultje + + * sys/oss/gstosssrc.c: (gst_osssrc_get): + Don't mix bytes and samples. + 2004-10-24 Ronald S. Bultje * ext/ogg/gstoggmux.c: diff --git a/sys/oss/gstosssrc.c b/sys/oss/gstosssrc.c index 1bd2521d..da7e61d7 100644 --- a/sys/oss/gstosssrc.c +++ b/sys/oss/gstosssrc.c @@ -382,7 +382,7 @@ gst_osssrc_get (GstPad * pad) GST_BUFFER_SIZE (buf) = readbytes; GST_BUFFER_OFFSET (buf) = src->curoffset; - GST_BUFFER_OFFSET_END (buf) = src->curoffset + readsamples; + GST_BUFFER_OFFSET_END (buf) = src->curoffset + readbytes; GST_BUFFER_DURATION (buf) = readsamples * GST_SECOND / GST_OSSELEMENT (src)->rate; @@ -391,7 +391,7 @@ gst_osssrc_get (GstPad * pad) if (src->clock == src->provided_clock) { /* if it's our own clock, we can be very accurate */ GST_BUFFER_TIMESTAMP (buf) = - src->curoffset * GST_SECOND / GST_OSSELEMENT (src)->rate; + src->curoffset * GST_SECOND / GST_OSSELEMENT (src)->bps; } else { /* somebody elses clock, timestamp with that clock, no discontinuity in * the stream since the OFFSET is updated correctly. Elements can stretch @@ -404,7 +404,7 @@ gst_osssrc_get (GstPad * pad) GST_BUFFER_TIMESTAMP (buf) = GST_CLOCK_TIME_NONE; } - src->curoffset += readsamples; + src->curoffset += readbytes; GST_DEBUG ("pushed buffer from soundcard of %ld bytes, timestamp %" G_GINT64_FORMAT, readbytes, GST_BUFFER_TIMESTAMP (buf)); -- cgit