diff --git a/server/streamreader/pcm_stream.cpp b/server/streamreader/pcm_stream.cpp index 01f0c8ce..7bc36777 100644 --- a/server/streamreader/pcm_stream.cpp +++ b/server/streamreader/pcm_stream.cpp @@ -257,8 +257,8 @@ void PcmStream::setState(ReaderState newState) void PcmStream::chunkEncoded(const encoder::Encoder& encoder, std::shared_ptr chunk, double duration) { std::ignore = encoder; - // LOG(TRACE, LOG_TAG) << "onChunkEncoded: " << getName() << ", duration: " << duration << " ms, compression ratio: " << 100 - ceil(100 * - // (chunk->durationMs() / duration)) << "%\n"; + // LOG(TRACE, LOG_TAG) << "onChunkEncoded: " << getName() << ", duration: " << duration + // << " ms, compression ratio: " << 100 - ceil(100 * (chunk->durationMs() / duration)) << "%\n"; if (duration <= 0) return; diff --git a/server/streamreader/stream_control.cpp b/server/streamreader/stream_control.cpp index e69ecd50..8186d6ad 100644 --- a/server/streamreader/stream_control.cpp +++ b/server/streamreader/stream_control.cpp @@ -253,7 +253,14 @@ void ScriptStreamControl::stop() { if (process_.running()) { + LOG(INFO, LOG_TAG) << "Stopping script '" << script_ << "'\n"; ::kill(-process_.native_handle(), SIGINT); + auto timeout = 500ms; + if (!process_.wait_for(timeout)) + { + LOG(INFO, LOG_TAG) << "Script did not terminate after " << timeout.count() << " ms, terminating.\n"; + process_.terminate(); + } } }