summaryrefslogtreecommitdiff
path: root/rotord/src
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src')
-rw-r--r--rotord/src/graph.cpp2
-rw-r--r--rotord/src/rendercontext.cpp7
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");