File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
libs/openFrameworks/video Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1084,11 +1084,17 @@ void ofMediaFoundationPlayer::setSpeed(float speed) {
10841084
10851085// ----------------------------------------------
10861086void ofMediaFoundationPlayer::setVolume (float volume) {
1087- if (m_spMediaEngine) {
1088- ofMediaFoundationUtils::CallAsyncBlocking (
1089- [&] {m_spMediaEngine->SetVolume (static_cast <double >(volume));
1090- });
1091- }
1087+ if (m_spMediaEngine) {
1088+ double cvolume = ofClamp (volume, 0 .0f , 1 .0f );
1089+ HRESULT hr = m_spMediaEngine->SetVolume (cvolume);
1090+ if (hr != S_OK) {
1091+ ofLogVerbose (" ofMediaFoundationPlayer :: setVolume : Unable to set volume to " ) << volume << " ." ;
1092+ }
1093+ // ofMediaFoundationUtils::CallAsyncBlocking(
1094+ // [&] {m_spMediaEngine->SetVolume(static_cast<double>(volume));
1095+ // [&] {m_spMediaEngine->SetVolume(cvolume);
1096+ // });
1097+ }
10921098}
10931099
10941100// ----------------------------------------------
You can’t perform that action at this time.
0 commit comments