-
Notifications
You must be signed in to change notification settings - Fork 302
Open
Description
Hi! I noticed that when trying to run libcec_mute_audio through the C library, it wouldn't work on my TV (I don't have an audio system).
It looks like SendMuteAudio is designed to send key presses if there isn't an audio system, but the C library doesn't use it:
C: src/libcec/LibCECC.cpp:
#if CEC_LIB_VERSION_MAJOR >= 5
int libcec_mute_audio(libcec_connection_t connection, int UNUSED(bSendRelease))
{
ICECAdapter* adapter = static_cast<ICECAdapter*>(connection);
return adapter ?
adapter->AudioToggleMute() :
-1;
}
#endifC++: src/libcec/LibCEC.cpp:
#if CEC_LIB_VERSION_MAJOR >= 5
uint8_t CLibCEC::MuteAudio(void)
{
return !!m_client ?
m_client->SendMuteAudio() :
(uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN;
}
#endifI'm working around this, by just sending key presses manually (I'm using https://github.com/ssalonen/cec-rs in Rust, which internally uses the C library):
fn mute(cec: &CecConnection) -> CecConnectionResult<()> {
cec.send_keypress(CecLogicalAddress::Tv, CecUserControlCode::Mute, true)?;
cec.send_key_release(CecLogicalAddress::Tv, true)?;
Ok(())
}Metadata
Metadata
Assignees
Labels
No labels