summaryrefslogtreecommitdiffstats
path: root/audio/avdtp.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-08-14 11:03:24 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-08-14 11:03:24 +0000
commit6e2276373f7f80dfd5947371fc46a35b3f8c48b9 (patch)
tree2bb5e05d67990a180c3ef0734db4fd2d9f434fe1 /audio/avdtp.c
parentfe09651ef69034b75126e0678455671ce57646fa (diff)
Also call stream state callback in error situations
Diffstat (limited to 'audio/avdtp.c')
-rw-r--r--audio/avdtp.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/audio/avdtp.c b/audio/avdtp.c
index 01571996..7efed380 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -463,18 +463,24 @@ static void avdtp_sep_set_state(struct avdtp *session,
{
struct avdtp_stream *stream = sep->stream;
avdtp_state_t old_state;
+ struct avdtp_error err, *err_ptr = NULL;
- if (sep->state == state)
- return;
-
- debug("stream state changed: %s -> %s", avdtp_statestr(sep->state),
- avdtp_statestr(state));
+ if (sep->state == state) {
+ avdtp_error_init(&err, AVDTP_ERROR_ERRNO, EIO);
+ debug("stream state change failed: %s", avdtp_strerror(&err));
+ err_ptr = &err;
+ } else {
+ err_ptr = NULL;
+ debug("stream state changed: %s -> %s",
+ avdtp_statestr(sep->state),
+ avdtp_statestr(state));
+ }
old_state = sep->state;
sep->state = state;
if (stream && stream->cb)
- stream->cb(stream, old_state, state, NULL,
+ stream->cb(stream, old_state, state, err_ptr,
stream->user_data);
if (state == AVDTP_STATE_IDLE) {