diff options
Diffstat (limited to 'rotord/src/rendercontext.h')
| -rw-r--r-- | rotord/src/rendercontext.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/rotord/src/rendercontext.h b/rotord/src/rendercontext.h index 130c678..0cecf49 100644 --- a/rotord/src/rendercontext.h +++ b/rotord/src/rendercontext.h @@ -82,23 +82,25 @@ namespace Rotor { } //interrupt locking process Render_status get_render_status(const string &uid){ - //cerr<<"render status requested: "<<uid<<" status: "<<renders[uid].status<<endl; - + graph.mutex.lock(); + //cerr<<"render status requested: "<<uid<<" status: "<<renders[uid].status<<endl; + if (renders.find(uid)!=renders.end()){ if (renders[uid].status==RENDERING){ renders[uid].progress=graph.progress; } + graph.mutex.unlock(); return renders[uid]; } - else return Render_status(NOT_FOUND); + graph.mutex.unlock(); + return Render_status(NOT_FOUND); + }; private: int state; //thread only does one thing at once std::deque<Session_task> work_queue; std::unordered_map<string,Render_status> renders; - Poco::Mutex mutex; //lock for access from parent thread - std::string output_filename; std::string graph_dir; std::string media_dir; @@ -106,6 +108,8 @@ namespace Rotor { std::string graph_filename; std::string graph_body; + Poco::Mutex mutex; //lock for access from parent thread + Audio_thumbnailer *audio_thumb; Graph graph; float output_framerate; |
