lib,requesthandler,eventhandler: Fix C4244 & C4334 warnings

This commit is contained in:
tytan652 2022-07-26 21:16:27 +02:00 committed by tt2468
parent e3314b3608
commit b5d50c4243
3 changed files with 4 additions and 4 deletions

View File

@ -96,7 +96,7 @@ static inline unsigned int obs_websocket_get_api_version(void)
if (!proc_handler_call(_ph, "get_api_version", &cd))
return 1; // API v1 does not include get_api_version
unsigned int ret = calldata_int(&cd, "version");
unsigned int ret = (unsigned int)calldata_int(&cd, "version");
calldata_free(&cd);

View File

@ -225,7 +225,7 @@ void EventHandler::HandleInputVolumeChanged(void *param, calldata_t *data)
// Volume must be grabbed from the calldata. Running obs_source_get_volume() will return the previous value.
double inputVolumeMul = calldata_float(data, "volume");
double inputVolumeDb = obs_mul_to_db(inputVolumeMul);
double inputVolumeDb = obs_mul_to_db((float)inputVolumeMul);
if (inputVolumeDb == -INFINITY)
inputVolumeDb = -100;

View File

@ -820,9 +820,9 @@ RequestResult RequestHandler::SetInputAudioTracks(const Request &request)
json inputAudioTracks = request.RequestData["inputAudioTracks"];
long long mixers = obs_source_get_audio_mixers(input);
uint32_t mixers = obs_source_get_audio_mixers(input);
for (long long i = 0; i < MAX_AUDIO_MIXES; i++) {
for (uint32_t i = 0; i < MAX_AUDIO_MIXES; i++) {
std::string track = std::to_string(i + 1);
if (!Utils::Json::Contains(inputAudioTracks, track))