Compare commits

...

3 Commits

Author SHA1 Message Date
0fd9baaf71 Fix never released activating_source
Some checks reported errors
continuous-integration/drone/push Build was killed
2024-12-17 21:16:30 +01:00
24342f5062 Fix undefined input.streams error 2024-12-17 21:16:30 +01:00
2b50886ed0 spdif: Handle soundcard asleep, try to wake up with a random bitrate 2024-12-17 21:16:30 +01:00
4 changed files with 15 additions and 8 deletions

View File

@ -80,6 +80,10 @@ func (s *SPDIFSource) Enable() error {
if err != nil {
return err
}
// If no bitrate, asume soundcard is sleeping, try to wake up with a random bitrate
if sr == 0 {
sr = 44100
}
s.Bitrate = sr
// If no bitrate, asume soundcard is sleeping, try to wake up with a random bitrate

View File

@ -25,7 +25,7 @@
</li>
{/if}
{#each $inputsList as input, iid}
{#if showInactives || input.active}
{#if input.streams && (showInactives || input.active)}
{#each Object.keys(input.streams) as idstream}
{@const title = input.streams[idstream]}
<li class="list-group-item py-3 d-flex flex-column">

View File

@ -4,12 +4,15 @@
let activating_source = null;
async function clickSource(src) {
activating_source = src.id;
if (src.enabled) {
await src.deactivate();
await sources.refresh();
} else {
await src.activate();
await sources.refresh();
try {
if (src.enabled) {
await src.deactivate();
await sources.refresh();
} else {
await src.activate();
await sources.refresh();
}
} catch {
}
activating_source = null;
}

View File

@ -48,7 +48,7 @@
<div class="d-inline-block me-3">
<div class="d-flex justify-content-between align-items-center">
<div>
{#if input.streams.length}
{#if input.streams && input.streams.length}
{#each Object.keys(input.streams) as idstream}
{@const title = input.streams[idstream]}
<strong>{title}</strong>