Add support for per service list of supported audio codecs

Currently only handles the vanilla OBS case of two possible codecs, i.e.
it won't list multiple listed supported codecs as alternatives in the
warning message; also doesn't verify that the listed codecs are actually
available in OBS

Other than that it supports multiple "supported audio codec" entries
in services.xconfig per service, in case anyone wants to white list
both MP3 and AAC for their service:

```
recommended : {
 "supported audio codec" : "MP3"
 "supported audio codec" : "AAC"
}
```
This commit is contained in:
palana 2014-02-15 20:08:55 +01:00
parent 2a9cf6e5d9
commit 2a1c4326b4
2 changed files with 14 additions and 0 deletions

View File

@ -315,6 +315,19 @@ void SettingsPublish::SetWarningInfo()
} }
} }
if (r->HasItem(L"supported audio codec"))
{
StringList codecs;
r->GetStringList(L"supported audio codec", codecs);
if (codecs.FindValueIndex(currentAudioCodec) == INVALID)
{
String msg = Str("Settings.Publish.Warning.UnsupportedAudioCodec"); //good thing OBS only supports MP3 (and AAC), otherwise I'd have to come up with a better translation solution
msg.FindReplace(L"$1", codecs[0].Array());
msg.FindReplace(L"$2", currentAudioCodec.Array());
strWarnings << msg;
}
}
break; break;
} }
} }

View File

@ -246,6 +246,7 @@ Settings.Publish.Warning.Maxbitrate="\tEncoding Settings: Reduce your maximum bi
Settings.Publish.Warning.RecommendMainProfile="\tAdvanced Settings: Recommended x264 encoding profile is 'main' for this service\r\n\r\n" Settings.Publish.Warning.RecommendMainProfile="\tAdvanced Settings: Recommended x264 encoding profile is 'main' for this service\r\n\r\n"
Settings.Publish.Warning.Keyint="\tAdvanced Settings: Set a keyframe interval of %d seconds\r\n\r\n" Settings.Publish.Warning.Keyint="\tAdvanced Settings: Set a keyframe interval of %d seconds\r\n\r\n"
Settings.Publish.Warning.MaxAudiobitrate="\tEncoding Settings: Reduce your audio bitrate to %d\r\n\r\n" Settings.Publish.Warning.MaxAudiobitrate="\tEncoding Settings: Reduce your audio bitrate to %d\r\n\r\n"
Settings.Publish.Warning.UnsupportedAudioCodec="\tEncoding Settings: Set audio codec to '$1' instead of '$2'\r\n\r\n"
Settings.Video.Custom="Custom:" Settings.Video.Custom="Custom:"
Settings.Video.Device="Video Adapter:" Settings.Video.Device="Video Adapter:"