Skip to content

Commit

Permalink
fix: none mode being seen as invalid option to RtspServerMode (#285)
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Casagrande <[email protected]>
  • Loading branch information
ajcasagrande authored Sep 18, 2023
1 parent 608e40c commit 3411f34
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions internal/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,11 @@ func (d *Driver) Initialize(sdk interfaces.DeviceServiceSDK) error {
d.rtspServerMode = RTSPServerMode(strings.ToLower(d.ds.DriverConfigs()[RtspServerMode]))
if d.rtspServerMode == "" {
d.rtspServerMode = RTSPServerModeInternal
} else {
if d.rtspServerMode != RTSPServerModeInternal && d.rtspServerMode != RTSPServerModeExternal {
return fmt.Errorf("%s value of \"%s\" is invalid. valid options are \"internal\", \"external\", and \"none\"",
RtspServerMode, d.rtspServerMode)
}
}

if d.rtspServerMode == RTSPServerModeNone {
} else if d.rtspServerMode == RTSPServerModeNone {
return nil // nothing left to do
} else if d.rtspServerMode != RTSPServerModeInternal && d.rtspServerMode != RTSPServerModeExternal {
return fmt.Errorf("%s value of \"%s\" is invalid. valid options are \"internal\", \"external\", and \"none\"",
RtspServerMode, d.rtspServerMode)
}

rtspAuthenticationServerUri, ok := d.ds.DriverConfigs()[RtspAuthenticationServer]
Expand Down

0 comments on commit 3411f34

Please sign in to comment.