diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-09-07 15:09:03 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-09-07 15:09:03 +0100 |
| commit | a8f03016896f929ab51631a42de4fc10c16233ae (patch) | |
| tree | 49387ec250e35ed850a8899e4ebe93b7d6713120 /rotord/src | |
| parent | c82fb2010c8ce4741f30f91816fca76d6de98dbf (diff) | |
cancelling audio analysis
Diffstat (limited to 'rotord/src')
| -rw-r--r-- | rotord/src/graph.cpp | 2 | ||||
| -rw-r--r-- | rotord/src/rendercontext.cpp | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp index 333d11c..f54b18c 100644 --- a/rotord/src/graph.cpp +++ b/rotord/src/graph.cpp @@ -532,7 +532,7 @@ bool Graph::load_audio(const string &filename,vector<Audio_processor*> processor AVFrame* frame=loader.get_frame(); int sample_processed=0; - while (frame) + while (frame&&!cancelled) { //now we can pass the data to the processor(s) for (auto p: processors) { diff --git a/rotord/src/rendercontext.cpp b/rotord/src/rendercontext.cpp index b40b385..d88bd68 100644 --- a/rotord/src/rendercontext.cpp +++ b/rotord/src/rendercontext.cpp @@ -420,11 +420,16 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H } if (command.commands[1]=="cancel") { if (command.method=="PUT") { - if (state==RENDERING||state==ANALYSING_AUDIO){ + if (state==RENDERING){ graph.cancelled=true; logger.information("Render cancelled."); XML.addValue("status","render cancelled"); } + else if (state==ANALYSING_AUDIO){ + graph.cancelled=true; + logger.information("Audio analysis cancelled."); + XML.addValue("status","audio analysis cancelled"); + } else { status=HTTPResponse::HTTP_BAD_REQUEST; logger.error("ERROR: no process to cancel"); |
