From 4750cc5a48751047ef27b15e359e5fcedd227342 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sat, 19 Sep 2020 17:15:33 +0200 Subject: [PATCH] restore RTSP_SERVER_PATH variable when using runOnDemand --- main_test.go | 2 +- path.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main_test.go b/main_test.go index 95cba516..313e0e88 100644 --- a/main_test.go +++ b/main_test.go @@ -481,7 +481,7 @@ func TestRunOnDemand(t *testing.T) { stdin := []byte("\n" + "paths:\n" + " ondemand:\n" + - " runOnDemand: ffmpeg -hide_banner -loglevel error -re -i test-images/ffmpeg/emptyvideo.ts -c copy -f rtsp rtsp://localhost:8554/ondemand\n") + " runOnDemand: ffmpeg -hide_banner -loglevel error -re -i test-images/ffmpeg/emptyvideo.ts -c copy -f rtsp rtsp://localhost:8554/$RTSP_SERVER_PATH\n") p1, err := newProgram([]string{"stdin"}, bytes.NewBuffer(stdin)) require.NoError(t, err) defer p1.close() diff --git a/path.go b/path.go index a334ab3e..811cb9ac 100644 --- a/path.go +++ b/path.go @@ -229,7 +229,7 @@ func (pa *path) onDescribe(client *client) { pa.lastDescribeActivation = time.Now() var err error - pa.onDemandCmd, err = startExternalCommand(pa.confp.RunOnDemand, "") + pa.onDemandCmd, err = startExternalCommand(pa.confp.RunOnDemand, pa.name) if err != nil { pa.log("ERR: %s", err) }