From f9c5d22fbefc6c54c8820273abb7487e4b4074d2 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 16 May 2004 23:30:00 +0000 Subject: [PATCH] ext/alsa/gstalsasink.c: use correct variable when determining amount of data to skip so we don't skip into the void a... Original commit message from CVS: * ext/alsa/gstalsasink.c: (gst_alsa_sink_loop): use correct variable when determining amount of data to skip so we don't skip into the void and segfault --- ChangeLog | 6 ++++++ ext/alsa/gstalsasink.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7d1ce59f0c..2e97eccb8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-05-17 Benjamin Otte + + * ext/alsa/gstalsasink.c: (gst_alsa_sink_loop): + use correct variable when determining amount of data to skip so we + don't skip into the void and segfault + 2004-05-16 Benjamin Otte * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_audio_caps): diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index fefe75cb38..03f4fa2dd9 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -335,6 +335,7 @@ gst_alsa_sink_loop (GstElement * element) g_return_if_fail (sink != NULL); sink_restart: + g_print ("start: %p, %u\n", sink->data[0], sink->size[0]); avail = gst_alsa_update_avail (this); if (avail == -EPIPE) @@ -441,7 +442,7 @@ sink_restart: sink->buf[i] = NULL; continue; } else if (sample_diff < 0) { - gint difference = gst_alsa_samples_to_bytes (this, -samplestamp); + gint difference = gst_alsa_samples_to_bytes (this, -sample_diff); GST_INFO_OBJECT (this, "Skipping %lu samples to resync: sample %lu expected, but got %ld", @@ -475,6 +476,7 @@ sink_restart: } /* FIXME: lotsa stuff can have happened while fetching data. Do we need to check something? */ + g_print ("transmit: %p, %u\n", sink->data[0], sink->size[0]); /* put this data into alsa */ if ((copied = this->transmit (this, &avail)) < 0)