Skip to contentSkip to conversation

Fix audio.conf parsing bug - sink and source were transposed.

PATCH In review Nick Pelly 3 participants 4 messages Aug 18, 2009 – Aug 22, 2009 Bluetooth drivers

lore
Share & tools
lore

Nick Pelly

author
#0 lore raw

PATCH 1/1 Fix audio.conf parsing bug - sink and source were transposed.

---
 audio/a2dp.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
audio/a2dp.c +4 -4
index 45be5d4..41b8f88 100644
@@ -1098,9 +1098,9 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
 		g_clear_error(&err);
 	} else {
 		if (strstr(str, "Sink"))
-			source = TRUE;
-		if (strstr(str, "Source"))
 			sink = TRUE;
+		if (strstr(str, "Source"))
+			source = TRUE;
 		g_free(str);
 	}
 
@@ -1111,9 +1111,9 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
 		g_clear_error(&err);
 	} else {
 		if (strstr(str, "Sink"))
-			source = FALSE;
-		if (strstr(str, "Source"))
 			sink = FALSE;
+		if (strstr(str, "Source"))
+			source = FALSE;
 		g_free(str);
 	}
 
Signature · 1 line
1.6.3.1
author
#1 lore raw
Quoted 33 lines · Nick Pelly

---
 audio/a2dp.c |    8 ++++----

 1 files changed, 4 insertions(+), 4 deletions(-)
audio/a2dp.c +4 -5
index 45be5d4..41b8f88 100644
@@ -1098,9 +1098,9 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
                g_clear_error(&err);
        } else {
                if (strstr(str, "Sink"))
-                       source = TRUE;
-               if (strstr(str, "Source"))
                        sink = TRUE;
+               if (strstr(str, "Source"))
+                       source = TRUE;
                g_free(str);
        }
 
@@ -1111,9 +1111,9 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
                g_clear_error(&err);
        } else {
                if (strstr(str, "Sink"))
-                       source = FALSE;
-               if (strstr(str, "Source"))
                        sink = FALSE;
+               if (strstr(str, "Source"))
+                       source = FALSE;
                g_free(str);
        }
 
--
Quoted 1 line

1.6.3.1

Jaikumar just gave me the heads up that this is by design.

Enable=Sink means that bluetoothd offers the Sink interface for remote devices - and that we are a source.
Enable=Source means that bluetoothd offers the Source interface for remote devices - and that we are a sink.

I'd say its counter-intuitive, but we can live with it.

Nick

#2 lore raw
Quoted 1 line · Nick Pelly

On Tue, Aug 18, 2009 at 3:32 PM, Nick Pelly<[email protected]> wrote:

<snip>

Quoted 8 lines

Jaikumar just gave me the heads up that this is by design.

Enable=Sink means that bluetoothd offers the Sink interface for remote devices - and that we are a source.
Enable=Source means that bluetoothd offers the Source interface for remote devices - and that we are a sink.

I'd say its counter-intuitive, but we can live with it.

Comments in the code could fix that?

maintainer
#3 lore raw

Hi Bastien,

Quoted 10 lines
Quoted 8 lines

Jaikumar just gave me the heads up that this is by design.

Enable=Sink means that bluetoothd offers the Sink interface for remote devices - and that we are a source.
Enable=Source means that bluetoothd offers the Source interface for remote devices - and that we are a sink.

I'd say its counter-intuitive, but we can live with it.

Comments in the code could fix that?

I prefer that we add comments in the code and the configuration file.

Nick, please send a patch that adds these comments.

Regards

Marcel