Get rid of hw_constraint function. It's code now lives inside bt_setconf().
authorJoão Paulo Rechi Vita <joao.vita@gmail.com>
Sat, 16 Aug 2008 19:00:32 +0000 (16:00 -0300)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Sep 2008 22:12:06 +0000 (01:12 +0300)
src/modules/module-bt-device.c

index 95257da..e808cfb 100644 (file)
@@ -410,6 +410,10 @@ static int bt_setconf(struct userdata *u) {
         }
     }
 
+    u->ss.format = PA_SAMPLE_S16LE;
+    u->ss.rate = u->rate;
+    u->ss.channels = u->channels;
+
     memset(setconf_req, 0, BT_AUDIO_IPC_PACKET_SIZE);
     setconf_req->h.msg_type = BT_SETCONFIGURATION_REQ;
     strncpy(setconf_req->device, u->addr, 18);
@@ -515,14 +519,6 @@ static int bt_getstreamfd(struct userdata *u) {
     return 0;
 }
 
-static int bt_hw_constraint(struct userdata *u) {
-    /*TODO: A2DP */
-    u->ss.format = PA_SAMPLE_S16LE;
-    u->ss.rate = 8000;
-    u->ss.channels = 1;
-    return 0;
-}
-
 static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
     struct userdata *u = PA_SINK(o)->userdata;
 
@@ -768,13 +764,6 @@ int pa__init(pa_module* m) {
         goto fail;
     }
 
-    /* configure hw supported sample specs */
-    e = bt_hw_constraint(u);
-    if (e < 0) {
-        pa_log_error("failed to configure sample spec");
-        goto fail;
-    }
-
     /* create sink */
     pa_sink_new_data_init(&data);
     data.driver = __FILE__;