summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-03-09 16:53:03 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2009-03-09 16:53:03 -0300
commit8f619dd6228f1cfa750e562d4e2ea89396e8b4fd (patch)
tree77071ba6138f072656a284ba8ccc538ec9e1acc7 /audio
parent959c5045ee72aa078a1f85491917d0e71c0aefe4 (diff)
Don't pass stream to config callback if there was an error
Diffstat (limited to 'audio')
-rw-r--r--audio/a2dp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/audio/a2dp.c b/audio/a2dp.c
index e633c855..83e12c9e 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -150,13 +150,15 @@ static gboolean finalize_config(struct a2dp_setup *s)
setup_ref(s);
for (l = s->cb; l != NULL; l = l->next) {
struct a2dp_setup_cb *cb = l->data;
+ struct avdtp_stream *stream = s->err ? NULL : s->stream;
- if (cb->config_cb) {
- cb->config_cb(s->session, s->sep, s->stream, s->err,
- cb->user_data);
- cb->config_cb = NULL;
- setup_unref(s);
- }
+ if (!cb->config_cb)
+ continue;
+
+ cb->config_cb(s->session, s->sep, stream, s->err,
+ cb->user_data);
+ cb->config_cb = NULL;
+ setup_unref(s);
}
setup_unref(s);