mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-09-27 04:36:12 +08:00
Change alsa source name for discovery API
This commit is contained in:
@@ -47,10 +47,13 @@ func apiAlsa(w http.ResponseWriter, r *http.Request) {
|
|||||||
r1, r2 := dev.RangeRates()
|
r1, r2 := dev.RangeRates()
|
||||||
c1, c2 := dev.RangeChannels()
|
c1, c2 := dev.RangeChannels()
|
||||||
source := &api.Source{
|
source := &api.Source{
|
||||||
Name: info.ID + " / " + info.Name + " / " + info.SubName,
|
Name: info.ID,
|
||||||
Info: fmt.Sprintf("Formats: %s, Rates: %d-%d, Channels: %d-%d", formats, r1, r2, c1, c2),
|
Info: fmt.Sprintf("Formats: %s, Rates: %d-%d, Channels: %d-%d", formats, r1, r2, c1, c2),
|
||||||
URL: "alsa:device?audio=" + path,
|
URL: "alsa:device?audio=" + path,
|
||||||
}
|
}
|
||||||
|
if !strings.Contains(source.Name, info.Name) {
|
||||||
|
source.Name += ", " + info.Name
|
||||||
|
}
|
||||||
sources = append(sources, source)
|
sources = append(sources, source)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user