diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-08-14 11:03:24 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-08-14 11:03:24 +0000 |
commit | 6e2276373f7f80dfd5947371fc46a35b3f8c48b9 (patch) | |
tree | 2bb5e05d67990a180c3ef0734db4fd2d9f434fe1 | |
parent | fe09651ef69034b75126e0678455671ce57646fa (diff) |
Also call stream state callback in error situations
-rw-r--r-- | audio/avdtp.c | 18 |
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) { |