[Feature][ZXW-41] merged 0601 version

Change-Id: I667af6bb09d65581d455b73f8984c160b2c67ad8
diff --git a/ap/lib/libvoice/voice_api.c b/ap/lib/libvoice/voice_api.c
index e6262fb..ba07e83 100755
--- a/ap/lib/libvoice/voice_api.c
+++ b/ap/lib/libvoice/voice_api.c
@@ -122,6 +122,7 @@
 

 int sc_audio_get_voice_device_mode(int *p_dev_mode)

 {

+    int ret = 0;

 	struct mixer *voice_mixer = NULL;

 	printf("%s: start!\n",__func__);

 

@@ -138,7 +139,7 @@
 	

 	if((*p_dev_mode < T_OUTPUT_HANDSET ) ||(*p_dev_mode >= T_OUTPUT_MAX)){

 		printf("%s: dev_mode not support, *p_dev_mode=%d!\n",__func__, *p_dev_mode);

-		//return -1;

+		ret = -1;

 	}

 	printf("%s: start *p_dev_mode=%d!\n",__func__, *p_dev_mode);

 

@@ -146,7 +147,7 @@
 	mixer_close(voice_mixer);

 	voice_mixer = NULL;

 

-	return 0;

+	return ret;

 	

 }

 

@@ -187,6 +188,7 @@
 

 int sc_audio_get_rx_voice_vol(int     * p_vol)

 {

+    int ret = 0;

 	struct mixer *voice_mixer = NULL;

 

 	printf("%s: start!\n",__func__);

@@ -204,7 +206,7 @@
 

 	if ((*p_vol < 0 ) ||(*p_vol > 11)){

 		printf("%s: vol not support, *p_vol=%d!\n",__func__, *p_vol);

-		//return -1;

+		ret = -1;

 	}

 	printf("%s:  *p_vol=%d!\n",__func__, *p_vol);

 

@@ -213,7 +215,7 @@
 	voice_mixer = NULL;

 

 

-	return 0;

+	return ret;

 

 	

 	

@@ -255,6 +257,7 @@
 

 int sc_audio_get_tx_voice_vol(int  *p_vol)

 {

+    int ret = 0;

 	struct mixer *voice_mixer = NULL;

 	printf("%s: start!\n",__func__);

 

@@ -272,14 +275,14 @@
 

 	if((*p_vol < 0 ) ||(*p_vol > 5)){

 		printf("%s: vol not support, *p_vol=%d!\n",__func__, *p_vol);

-		//return -1;

+		ret = -1;

 	}

 	printf("%s:  *p_vol=%d!\n",__func__, *p_vol);

 

 	//close mixer

 	mixer_close(voice_mixer);

 	voice_mixer = NULL;	

-    return 0;	

+    return ret;	

 }

 

 

@@ -313,6 +316,7 @@
 

 int sc_audio_get_tx_voice_mute_state(int *p_mute)

 {

+    int ret = 0;

 	struct mixer *voice_mixer = NULL;

 

 	printf("%s: start!\n",__func__);

@@ -330,10 +334,8 @@
 

 	if((*p_mute != 0 ) &&(*p_mute != 1)) {

 		printf("%s: *p_mute not support, *p_mute=%d!\n",__func__, *p_mute);

-		//close mixer

-	    mixer_close(voice_mixer);

-	    voice_mixer = NULL;	

-		return -1;

+			

+		ret = -1;

 	}

 	printf("%s:  *p_mute=%d!\n",__func__, *p_mute);

 

@@ -341,7 +343,7 @@
 	mixer_close(voice_mixer);

 	voice_mixer = NULL;	

 

-    return 0;

+    return ret;

 }

 

 

@@ -378,7 +380,9 @@
 }

 

 

-int sc_audio_get_rx_voice_mute_state(int *p_mute){

+int sc_audio_get_rx_voice_mute_state(int *p_mute)

+{

+    int ret = 0;

 	struct mixer *voice_mixer = NULL;

 

 	printf("%s: start!\n",__func__);

@@ -396,10 +400,7 @@
 	if((*p_mute != 0 ) &&(*p_mute != 1)) {

 

 		printf("%s: *p_mute not support, *p_mute=%d!\n",__func__, *p_mute);

-		//close mixer

-	    mixer_close(voice_mixer);

-	    voice_mixer = NULL;

-		return -1;

+		ret = -1;

 	}

 	printf("%s:  *p_mute=%d!\n",__func__, *p_mute);

 

@@ -407,7 +408,7 @@
 	mixer_close(voice_mixer);

 	voice_mixer = NULL;	

 

-    return 0;

+    return ret;

 

 }