Simple lock, assignment, unlock sandwich optimization.
[asterisk/asterisk.git] / bridges / bridge_native_rtp.c
index 1117e5a..5b03726 100644 (file)
@@ -18,7 +18,7 @@
 
 /*! \file
  *
- * \brief Native RTP bridging module
+ * \brief Native RTP bridging technology module
  *
  * \author Joshua Colp <jcolp@digium.com>
  *
@@ -251,15 +251,13 @@ static int native_rtp_bridge_framehook_attach(struct ast_bridge_channel *bridge_
        }
 
        ast_channel_lock(bridge_channel->chan);
-
-       if (!(data->id = ast_framehook_attach(bridge_channel->chan, &hook)) < 0) {
-               ast_channel_unlock(bridge_channel->chan);
+       data->id = ast_framehook_attach(bridge_channel->chan, &hook);
+       ast_channel_unlock(bridge_channel->chan);
+       if (!data->id < 0) {
                ao2_cleanup(data);
                return -1;
        }
 
-       ast_channel_unlock(bridge_channel->chan);
-
        bridge_channel->bridge_pvt = data;
 
        return 0;