Index: webrtc/base/bufferqueue.cc |
diff --git a/webrtc/base/bufferqueue.cc b/webrtc/base/bufferqueue.cc |
index 1ac57abc0cad425d132a0e1b5f69a438f13eab88..ce83e53f691a31f2822784f02b5e2e9ce5479c03 100644 |
--- a/webrtc/base/bufferqueue.cc |
+++ b/webrtc/base/bufferqueue.cc |
@@ -32,6 +32,14 @@ size_t BufferQueue::size() const { |
return queue_.size(); |
} |
+void BufferQueue::Clear() { |
+ CritScope cs(&crit_); |
+ while (!queue_.empty()) { |
+ free_list_.push_back(queue_.front()); |
+ queue_.pop_front(); |
+ } |
+} |
+ |
bool BufferQueue::ReadFront(void* buffer, size_t bytes, size_t* bytes_read) { |
CritScope cs(&crit_); |
if (queue_.empty()) { |