diff options
author | Mikhail Zabaluev <mikhail.zabaluev@nokia.com> | 2011-09-19 14:40:22 +0300 |
---|---|---|
committer | Mikhail Zabaluev <mikhail.zabaluev@nokia.com> | 2011-09-19 15:05:52 +0300 |
commit | 3af886220f3132c36dcc86f3f00e80dcf89eaf9f (patch) | |
tree | dd11246621d44c8b91243574229062143294ed9c | |
parent | ea149b859510465782c57abf88828c9fbb16050b (diff) |
Clear pending send flag if its stream direction is disabledtelepathy-sofiasip-0.6
When a stream direction is requested to be off by either party,
its associated pending send flag has no reason to be set any longer.
-rw-r--r-- | src/sip-media-stream.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/sip-media-stream.c b/src/sip-media-stream.c index cd47788..f6c4806 100644 --- a/src/sip-media-stream.c +++ b/src/sip-media-stream.c @@ -1222,7 +1222,12 @@ tpsip_media_stream_set_direction (TpsipMediaStream *stream, priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); pending_send_flags = priv->pending_send_flags & pending_send_mask; - if ((direction & ~priv->direction & TP_MEDIA_STREAM_DIRECTION_SEND) != 0) + if ((direction & TP_MEDIA_STREAM_DIRECTION_SEND) == 0) + { + /* We won't be sending, clear the pending local send flag */ + pending_send_flags &= ~TP_MEDIA_STREAM_PENDING_LOCAL_SEND; + } + else if ((direction & TP_MEDIA_STREAM_DIRECTION_SEND & ~priv->direction) != 0) { /* We are requested to start sending, but... */ if ((pending_send_mask @@ -1245,9 +1250,15 @@ tpsip_media_stream_set_direction (TpsipMediaStream *stream, priv->pending_remote_receive = TRUE; } } - if ((direction & ~priv->direction & TP_MEDIA_STREAM_DIRECTION_RECEIVE) != 0 - && (pending_send_mask - & TP_MEDIA_STREAM_PENDING_REMOTE_SEND) != 0) + + if ((direction & TP_MEDIA_STREAM_DIRECTION_RECEIVE) == 0) + { + /* We are not going to receive, clear the pending remote send flag */ + pending_send_flags &= ~TP_MEDIA_STREAM_PENDING_REMOTE_SEND; + } + else if ((direction & TP_MEDIA_STREAM_DIRECTION_RECEIVE & ~priv->direction) != 0 + && (pending_send_mask + & TP_MEDIA_STREAM_PENDING_REMOTE_SEND) != 0) { /* We're requested to start receiving, but the remote end did not * confirm if it will send. Set the pending send flag. */ |