mirror of https://bitbucket.org/ausocean/av.git
treatment: restart audio when path changed
This commit is contained in:
parent
8b4e28a944
commit
e3f8af1e78
|
@ -184,13 +184,6 @@ func run(rv *revid.Revid, ns *netsender.Sender, file *string, l *logger.Logger,
|
|||
}
|
||||
l.Log(logger.Info, "revid successfully reconfigured")
|
||||
|
||||
l.Log(logger.Debug, "checking audio file path")
|
||||
f := vars["audioFilePath"]
|
||||
if f != "" && *file != f {
|
||||
file = &f
|
||||
l.Log(logger.Info, "updated audio file path", "audioFilePath", f)
|
||||
}
|
||||
|
||||
l.Log(logger.Debug, "checking mode")
|
||||
switch ns.Mode() {
|
||||
case modePaused:
|
||||
|
@ -198,6 +191,14 @@ func run(rv *revid.Revid, ns *netsender.Sender, file *string, l *logger.Logger,
|
|||
l.Log(logger.Info, "mode is Paused, stopping revid")
|
||||
rv.Stop()
|
||||
case modeTreatment:
|
||||
l.Log(logger.Debug, "checking audio file path")
|
||||
f := vars["audioFilePath"]
|
||||
if f != "" && *file != f {
|
||||
file = &f
|
||||
l.Log(logger.Info, "updated audio file path", "audioFilePath", f)
|
||||
l.Log(logger.Info, "stopping audio")
|
||||
stopAudio(&wg, &treating, audioQuit)
|
||||
}
|
||||
if !treating {
|
||||
l.Log(logger.Info, "starting audio treatment")
|
||||
rv.Stop()
|
||||
|
|
Loading…
Reference in New Issue