$OpenBSD: patch-sys_oss_gstosshelper_c,v 1.1.1.1 2012/09/06 13:01:31 ajacoutot Exp $
: patch-sys_oss_gstosshelper_c,v 1.4 2010/04/28 08:03:23 ajacoutot Exp $
--- sys/oss/gstosshelper.c.orig	Sun Apr 22 19:59:30 2012
+++ sys/oss/gstosshelper.c	Wed Sep  5 13:44:49 2012
@@ -207,6 +207,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 ();
@@ -234,6 +235,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);
+    if (probe->min == -1)
+        probe->min = gst_oss_helper_rate_check_rate (probe, 32000);
+    if (probe->min == -1)
+        probe->min = gst_oss_helper_rate_check_rate (probe, 44100);
+    if (probe->min == -1)
+        probe->min = gst_oss_helper_rate_check_rate (probe, 48000);
     probe->max = gst_oss_helper_rate_check_rate (probe, 48000);
   }
   if (probe->min == -1 || probe->max == -1) {
@@ -258,19 +265,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
