errors should be reported with negative values instead of booleans.

Signed-off-by: Wang Xingchao <[email protected]>
---
 src/pulsecore/sink-input.c |   10 +++++-----
 src/pulsecore/sink-input.h |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index f6f7324..0fc8760 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -142,8 +142,8 @@ void 
pa_sink_input_new_data_set_muted(pa_sink_input_new_data *data, pa_bool_t mu
     data->muted = !!mute;
 }
 
-pa_bool_t pa_sink_input_new_data_set_sink(pa_sink_input_new_data *data, 
pa_sink *s, pa_bool_t save) {
-    pa_bool_t ret = TRUE;
+int pa_sink_input_new_data_set_sink(pa_sink_input_new_data *data, pa_sink *s, 
pa_bool_t save) {
+    int ret = PA_OK;
     pa_idxset *formats = NULL;
 
     pa_assert(data);
@@ -168,14 +168,14 @@ pa_bool_t 
pa_sink_input_new_data_set_sink(pa_sink_input_new_data *data, pa_sink
             /* Sink doesn't support any of the formats requested by the client 
*/
             if (formats)
                 pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, 
NULL);
-            ret = FALSE;
+            ret = -PA_ERR_NOTSUPPORTED;
         }
     }
 
     return ret;
 }
 
-pa_bool_t pa_sink_input_new_data_set_formats(pa_sink_input_new_data *data, 
pa_idxset *formats) {
+int pa_sink_input_new_data_set_formats(pa_sink_input_new_data *data, pa_idxset 
*formats) {
     pa_assert(data);
     pa_assert(formats);
 
@@ -189,7 +189,7 @@ pa_bool_t 
pa_sink_input_new_data_set_formats(pa_sink_input_new_data *data, pa_id
         return pa_sink_input_new_data_set_sink(data, data->sink, 
data->save_sink);
     }
 
-    return TRUE;
+    return PA_OK;
 }
 
 void pa_sink_input_new_data_done(pa_sink_input_new_data *data) {
diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
index af2177a..28e0ae6 100644
--- a/src/pulsecore/sink-input.h
+++ b/src/pulsecore/sink-input.h
@@ -308,8 +308,8 @@ void 
pa_sink_input_new_data_set_volume(pa_sink_input_new_data *data, const pa_cv
 void pa_sink_input_new_data_apply_volume_factor(pa_sink_input_new_data *data, 
const pa_cvolume *volume_factor);
 void pa_sink_input_new_data_apply_volume_factor_sink(pa_sink_input_new_data 
*data, const pa_cvolume *volume_factor);
 void pa_sink_input_new_data_set_muted(pa_sink_input_new_data *data, pa_bool_t 
mute);
-pa_bool_t pa_sink_input_new_data_set_sink(pa_sink_input_new_data *data, 
pa_sink *s, pa_bool_t save);
-pa_bool_t pa_sink_input_new_data_set_formats(pa_sink_input_new_data *data, 
pa_idxset *formats);
+int pa_sink_input_new_data_set_sink(pa_sink_input_new_data *data, pa_sink *s, 
pa_bool_t save);
+int pa_sink_input_new_data_set_formats(pa_sink_input_new_data *data, pa_idxset 
*formats);
 void pa_sink_input_new_data_done(pa_sink_input_new_data *data);
 
 /* To be called by the implementing module only */
-- 
1.7.9.5

_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to