Fix a counting error that was causing the oss audio sink to perform

half a million audio ioctls on variable rate devices before it got
around to playing any sound.  Unbreaks gstreamer on auich.  Upstream
as gnome bug 538068.

ok espie, ajacoutot
This commit is contained in:
deanna 2008-06-14 17:17:26 +00:00
parent 73772d8aeb
commit 4072355c54
2 changed files with 42 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.19 2008/06/01 08:21:15 sthen Exp $
# $OpenBSD: Makefile,v 1.20 2008/06/14 17:17:26 deanna Exp $
COMMENT-main = multimedia framework - good plugins
COMMENT-aalib = multimedia framework - aalib plugin
@ -17,7 +17,7 @@ COMMENT-shout = multimedia framework - shoutcast plugin
V = 0.10.8
DISTNAME = gst-plugins-good-$V
PKGNAME-main = gstreamer-plugins-good-$Vp1
PKGNAME-main = gstreamer-plugins-good-$Vp2
PKGNAME-aalib = gstreamer-aalib-$V
PKGNAME-cairo = gstreamer-cairo-$Vp0
PKGNAME-gconf = gstreamer-confelements-$V

View File

@ -1,7 +1,15 @@
$OpenBSD: patch-sys_oss_gstosshelper_c,v 1.2 2008/05/13 15:11:51 espie Exp $
--- sys/oss/gstosshelper.c.orig Tue Apr 8 21:49:34 2008
+++ sys/oss/gstosshelper.c Mon May 12 14:28:03 2008
@@ -254,6 +254,12 @@ gst_oss_helper_rate_probe_check (GstOssProbe * probe)
$OpenBSD: patch-sys_oss_gstosshelper_c,v 1.3 2008/06/14 17:17:26 deanna Exp $
--- sys/oss/gstosshelper.c.orig Tue Apr 8 15:49:34 2008
+++ sys/oss/gstosshelper.c Fri Jun 13 11:06:46 2008
@@ -227,6 +227,7 @@ gst_oss_helper_rate_probe_check (GstOssProbe * probe)
int exact_rates = 0;
gboolean checking_exact_rates = TRUE;
int n_checks = 0;
+ int max_exact_matches = 20;
gboolean result = TRUE;
ranges = g_queue_new ();
@@ -254,6 +255,12 @@ gst_oss_helper_rate_probe_check (GstOssProbe * probe)
* driver is seriously buggy, and probably doesn't work with other
* media libraries/apps. */
probe->min = gst_oss_helper_rate_check_rate (probe, 8000);
@ -14,3 +22,31 @@ $OpenBSD: patch-sys_oss_gstosshelper_c,v 1.2 2008/05/13 15:11:51 espie Exp $
probe->max = gst_oss_helper_rate_check_rate (probe, 48000);
}
if (probe->min == -1 || probe->max == -1) {
@@ -278,19 +285,15 @@ gst_oss_helper_rate_probe_check (GstOssProbe * probe)
}
n_checks++;
- if (mid == mid_ret && checking_exact_rates) {
- int max_exact_matches = 20;
-
+ if (mid == mid_ret && checking_exact_rates)
exact_rates++;
- if (exact_rates > max_exact_matches) {
- GST_DEBUG ("got %d exact rates, assuming all are exact",
- max_exact_matches);
- result = FALSE;
- g_free (range);
- break;
- }
- } else {
- checking_exact_rates = FALSE;
+
+ if (exact_rates > max_exact_matches) {
+ GST_DEBUG ("got %d exact rates, assuming all are exact",
+ max_exact_matches);
+ result = FALSE;
+ g_free (range);
+ break;
}
/* Assume that the rate is arithmetically rounded to the nearest