diff --git a/OMXAudio.cpp b/OMXAudio.cpp index d22b0c7b..485c4b03 100644 --- a/OMXAudio.cpp +++ b/OMXAudio.cpp @@ -97,7 +97,7 @@ bool COMXAudio::PortSettingsChanged() if(!m_omx_mixer.Initialize("OMX.broadcom.audio_mixer", OMX_IndexParamAudioInit)) return false; } - if(m_config.device == "omx:both") + if(m_config.device == "omx:both" || m_config.device == "omx:alsa+hdmi") { if(!m_omx_splitter.Initialize("OMX.broadcom.audio_splitter", OMX_IndexParamAudioInit)) return false; @@ -107,12 +107,12 @@ bool COMXAudio::PortSettingsChanged() if(!m_omx_render_analog.Initialize("OMX.broadcom.audio_render", OMX_IndexParamAudioInit)) return false; } - if (m_config.device == "omx:both" || m_config.device == "omx:hdmi") + if (m_config.device == "omx:both" || m_config.device == "omx:hdmi" || m_config.device == "omx:alsa+hdmi") { if(!m_omx_render_hdmi.Initialize("OMX.broadcom.audio_render", OMX_IndexParamAudioInit)) return false; } - if (m_config.device == "omx:alsa") + if (m_config.device == "omx:alsa" || m_config.device == "omx:alsa+hdmi") { if(!m_omx_render_analog.Initialize("OMX.alsa.audio_render", OMX_IndexParamAudioInit)) return false; @@ -232,7 +232,7 @@ bool COMXAudio::PortSettingsChanged() // when in dual audio mode, make analogue the slave OMX_CONFIG_BOOLEANTYPE configBool; OMX_INIT_STRUCTURE(configBool); - configBool.bEnabled = m_config.is_live || m_config.device == "omx:both" ? OMX_FALSE:OMX_TRUE; + configBool.bEnabled = m_config.is_live || (m_config.device == "omx:both" || m_config.device == "omx:alsa+hdmi") ? OMX_FALSE:OMX_TRUE; omx_err = m_omx_render_analog.SetConfig(OMX_IndexConfigBrcmClockReferenceSource, &configBool); if (omx_err != OMX_ErrorNone) @@ -240,7 +240,7 @@ bool COMXAudio::PortSettingsChanged() OMX_CONFIG_BRCMAUDIODESTINATIONTYPE audioDest; OMX_INIT_STRUCTURE(audioDest); - strncpy((char *)audioDest.sName, m_config.device == "omx:alsa" ? m_config.subdevice.c_str() : "local", sizeof(audioDest.sName)); + strncpy((char *)audioDest.sName, (m_config.device == "omx:alsa" || m_config.device == "omx:alsa+hdmi") ? m_config.subdevice.c_str() : "local", sizeof(audioDest.sName)); omx_err = m_omx_render_analog.SetConfig(OMX_IndexConfigBrcmAudioDestination, &audioDest); if (omx_err != OMX_ErrorNone) { diff --git a/README.md b/README.md index 241b8d67..39df355a 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Usage: omxplayer [OPTIONS] [FILE] -v --version Print version info -k --keys Print key bindings -n --aidx index Audio stream index : e.g. 1 - -o --adev device Audio out device : e.g. hdmi/local/both/alsa[:device] + -o --adev device Audio out device : e.g. hdmi/local/both/alsa[:device]/alsa+hdmi[:device] -i --info Dump stream format and exit -I --with-info dump stream format before playback -s --stats Pts and buffer stats diff --git a/omxplayer.cpp b/omxplayer.cpp index 428ccb66..43146f35 100644 --- a/omxplayer.cpp +++ b/omxplayer.cpp @@ -721,9 +721,9 @@ int main(int argc, char *argv[]) } } if(m_config_audio.device != "local" && m_config_audio.device != "hdmi" && m_config_audio.device != "both" && - m_config_audio.device != "alsa") + m_config_audio.device != "alsa" && m_config_audio.device != "alsa+hdmi") { - printf("Bad argument for -%c: Output device must be `local', `hdmi', `both' or `alsa'\n", c); + printf("Bad argument for -%c: Output device must be `local', `hdmi', `both', `alsa' or `alsa+hdmi'\n", c); return EXIT_FAILURE; } m_config_audio.device = "omx:" + m_config_audio.device; @@ -1148,7 +1148,8 @@ int main(int argc, char *argv[]) m_config_audio.device = "omx:local"; } - if(m_config_audio.device == "omx:alsa" && m_config_audio.subdevice.empty()) + if ((m_config_audio.device == "omx:alsa" || + m_config_audio.device == "omx:alsa+hdmi") && m_config_audio.subdevice.empty()) m_config_audio.subdevice = "default"; if ((m_config_audio.hints.codec == AV_CODEC_ID_AC3 || m_config_audio.hints.codec == AV_CODEC_ID_EAC3) &&