]> git.sesse.net Git - cubemap/blobdiff - server.cpp
Add Metacube headers in add_data_deferred(), not add_data().
[cubemap] / server.cpp
index 6d5cce372ae9c79b81b4b755052252680ce3cf28..2eb33ed9edcac0ff793f779a7fec21db4cc6b058 100644 (file)
@@ -250,7 +250,7 @@ void Server::set_mark_pool(const string &stream_id, MarkPool *mark_pool)
 void Server::add_data_deferred(const string &stream_id, const char *data, size_t bytes)
 {
        MutexLock lock(&queued_data_mutex);
-       queued_data[stream_id].append(string(data, data + bytes));
+       find_stream(stream_id)->add_data_deferred(data, bytes);
 }
 
 // See the .h file for postconditions after this function.     
@@ -571,12 +571,9 @@ void Server::process_queued_data()
        }
        queued_add_clients.clear();     
        
-       for (map<string, string>::iterator queued_it = queued_data.begin();
-            queued_it != queued_data.end();
-            ++queued_it) {
-               Stream *stream = find_stream(queued_it->first);
-               stream->add_data(queued_it->second.data(), queued_it->second.size());
-               stream->wake_up_all_clients();
+       for (map<string, Stream *>::iterator stream_it = streams.begin();
+            stream_it != streams.end();
+            ++stream_it) {
+               stream_it->second->process_queued_data();
        }
-       queued_data.clear();
 }