fix(audio): a DEBUG build never shares the pipe name with Release
Creator was recording on the Release build and hit "Couldn't start the audio — another copy of LlamaCasty is already using the audio pipe" when going live on Debug. The guard did its job (no crash), but the collision should not have been possible: the pipe name only suffixed when `YTLIVE_INSTANCE` was set, and a Debug launched straight from the IDE has no id — so it asked for the same `ytllive_audio` the Release build was serving. DEBUG now always suffixes: the claimed instance id when there is one, otherwise the process id. Any number of dev builds can run beside the Release app, and each Debug process is distinct from every other. Release is unchanged — it resolves to the plain name, and the whole mechanism disappears in `#if DEBUG` as before. `TryStartAudioPipe` now logs the resolved name (`Audio pipe: …`), so the next report of this kind is one grep instead of a code hunt. Tests: AudioPipeInstanceTests pins that an id-less DEBUG process never resolves to the bare name; 572 green, 0 warnings.
This commit is contained in:
@@ -79,9 +79,11 @@ public partial class MainViewModel : ViewModelBase
|
||||
/// </summary>
|
||||
private bool TryStartAudioPipe()
|
||||
{
|
||||
var pipeName = InstanceProfile.AudioPipeName(EncoderOptions.DefaultAudioPipeName);
|
||||
try
|
||||
{
|
||||
_audioMixer.StartLive(InstanceProfile.AudioPipeName(EncoderOptions.DefaultAudioPipeName));
|
||||
_audioMixer.StartLive(pipeName);
|
||||
AppLog.Write($"Audio pipe: {pipeName}");
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user