pulsesink: remove ringbuffer reset compensation

Remove the code to deal with a ringbuffer reset as this code is now in the base
class.
Bump the -base requirement as we need the new baseaudiosink code to function
properly.
This commit is contained in:
Wim Taymans 2009-09-09 16:25:06 +02:00
parent 75a48e238a
commit 42ee5e22a2
2 changed files with 2 additions and 30 deletions

View file

@ -48,7 +48,7 @@ AM_PROG_LIBTOOL
dnl *** required versions of GStreamer stuff ***
GST_REQ=0.10.24.1
GSTPB_REQ=0.10.24
GSTPB_REQ=0.10.24.1
dnl *** autotools stuff ****

View file

@ -105,7 +105,6 @@ struct _GstPulseRingBuffer
pa_stream *stream;
pa_sample_spec sample_spec;
gint64 offset;
gboolean corked;
gboolean in_commit;
@ -572,7 +571,6 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
pa_stream_flags_t flags;
const gchar *name;
GstAudioClock *clock;
gint64 time_offset;
psink = GST_PULSESINK_CAST (GST_OBJECT_PARENT (buf));
pbuf = GST_PULSERING_BUFFER_CAST (buf);
@ -666,19 +664,6 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
/* our clock will now start from 0 again */
clock = GST_AUDIO_CLOCK (GST_BASE_AUDIO_SINK (psink)->provided_clock);
gst_audio_clock_reset (clock, 0);
time_offset = clock->abidata.ABI.time_offset;
GST_LOG_OBJECT (psink, "got time offset %" GST_TIME_FORMAT,
GST_TIME_ARGS (time_offset));
/* calculate the sample offset for 0 */
if (time_offset > 0)
pbuf->offset = gst_util_uint64_scale_int (time_offset,
pbuf->sample_spec.rate, GST_SECOND);
else
pbuf->offset = -gst_util_uint64_scale_int (-time_offset,
pbuf->sample_spec.rate, GST_SECOND);
GST_LOG_OBJECT (psink, "sample offset %" G_GINT64_FORMAT, pbuf->offset);
for (;;) {
pa_stream_state_t state;
@ -1139,21 +1124,8 @@ gst_pulseringbuffer_commit (GstRingBuffer * buf, guint64 * sample,
if (pbuf->paused)
goto was_paused;
/* correct for sample offset against the internal clock */
offset = *sample;
if (pbuf->offset >= 0) {
if (offset > pbuf->offset)
offset -= pbuf->offset;
else
offset = 0;
} else {
if (offset > -pbuf->offset)
offset += pbuf->offset;
else
offset = 0;
}
/* offset is in bytes */
offset *= bps;
offset = *sample * bps;
while (*toprocess > 0) {
size_t avail;