Skip to contentSkip to conversation

snd_ctl_elem_info_get_dimension? fixes

PATCH New Giuliano Pochini 1 participant 1 message Jul 13, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 snd_ctl_elem_info_get_dimension? fixes

It's against alsa-lib 0.9.5. It also applies to the CVS version because the files are identical.

src/control/control.c renamed from src/control/control.c_old +3 -3
@@ -1699,10 +1699,10 @@
 	assert(obj);
 	if (obj->access & SNDRV_CTL_ELEM_ACCESS_DINDIRECT)
 		return 0;			/* FIXME: implement indirect access as well */
-	for (i = 3; i >= 0; i++)
+	for (i = 3; i >= 0; i--)
 		if (obj->dimen.d[i])
 			break;
-	return i >= 0 ? i + 1 : 0;
+	return i + 1;
 }
 use_default_symbol_version(__snd_ctl_elem_info_get_dimensions, snd_ctl_elem_info_get_dimensions, ALSA_0.9.3);
 
@@ -1722,7 +1722,7 @@
 		return 0;			/* FIXME: implement indirect access as well */
 	if (idx >= 3)
 		return 0;
-	return obj->dimen.d[0];
+	return obj->dimen.d[idx];
 }
 use_default_symbol_version(__snd_ctl_elem_info_get_dimension, snd_ctl_elem_info_get_dimension, ALSA_0.9.3);
 
Signature · 9 lines
Bye.
   Giuliano.


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1