Commit 0c922cc9 authored by Thomas Vander Stichele's avatar Thomas Vander Stichele
Browse files

check error code correctly

Original commit message from CVS:
check error code correctly
parent 571a5cd7
2004-06-02 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/alsa/gstalsaclock.c: (gst_alsa_clock_get_type):
* ext/alsa/gstalsasrc.c: (gst_alsa_src_loop):
check error condition on available samples correctly
2004-06-02 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/alsa/gstalsasrc.c: (gst_alsa_src_get_time):
......
......@@ -329,11 +329,19 @@ gst_alsa_src_loop (GstElement * element)
}
}
while ((avail = gst_alsa_update_avail (this)) < this->period_size) {
if (avail == -EPIPE)
/* the cast to long is explicitly needed;
* with avail = -32 and period_size = 100, avail < period_size is false */
while ((avail = gst_alsa_update_avail (this)) < (long) this->period_size) {
if (avail == -EPIPE) {
GST_DEBUG_OBJECT (this, "got EPIPE when checking for available bytes");
continue;
if (avail < 0)
}
if (avail < 0) {
GST_DEBUG_OBJECT (this,
"got error %s (%d) when checking for available bytes",
snd_strerror (avail));
return;
}
if (snd_pcm_state (this->handle) != SND_PCM_STATE_RUNNING) {
if (!gst_alsa_start (this))
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment