]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
flush queued frames on audio sync event
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 14 Apr 2009 17:29:38 +0000 (17:29 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 14 Apr 2009 17:29:38 +0000 (17:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13018 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_loopback/mod_loopback.c

index 5985d2d875a89104dcd792c284043e682587cef4..49731e7b5d3e1f16542ba07c70ca9cb0f4a9c0af 100644 (file)
@@ -688,6 +688,25 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
        default:
                break;
        }
+
+       switch (msg->message_id) {
+       case SWITCH_MESSAGE_INDICATE_BRIDGE:
+       case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
+       case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC:
+               {
+                       void *pop;
+
+                       while (switch_queue_trypop(tech_pvt->frame_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
+                               switch_frame_t *frame = (switch_frame_t *) pop;
+                               switch_frame_free(&frame);
+                       }
+               }
+               break;
+    default:
+        break;
+    }
+       
+
        return SWITCH_STATUS_SUCCESS;
 }