diff --git a/audio/transport.c b/audio/transport.c
index 934bf37..281895e 100644
--- a/audio/transport.c
+++ b/audio/transport.c
if (lock == 0)
return btd_error_invalid_args(msg);
+ if (transport->state != TRANSPORT_STATE_PENDING &&
+ g_strstr_len(accesstype, -1, "?") != NULL)
+ return btd_error_failed(msg, "Transport not playing");
+
if (media_transport_acquire(transport, lock) == FALSE)
return btd_error_not_authorized(msg);
diff --git a/doc/media-api.txt b/doc/media-api.txt
index da8ef53..b9802d9 100644
--- a/doc/media-api.txt
+++ b/doc/media-api.txt
"rw": Read and write access
+ The accesstype string can also be combined with a "?"
+ suffix, which will make the request optional. This
+ typically means the transport will only be acquired if
+ it is already available (remote-initiated), but
+ otherwise no request will be sent to the remote side.
+ In this last case the function will fail. Note that,
+ due to compatibility issues with older versions of
+ BlueZ, clients are encouraged to use exactly the same
+ accesstype for Release(), matching the string provided
+ to Acquire().
+
void Release(string accesstype)
Releases file descriptor.