Skip to content

Commit

Permalink
Use dcadec on IMX and RPI - move setting to audio output
Browse files Browse the repository at this point in the history
  • Loading branch information
fritsch authored and popcornmix committed May 8, 2015
1 parent c518545 commit 010dbbb
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 18 deletions.
8 changes: 4 additions & 4 deletions addons/resource.language.en_gb/resources/strings.po
Expand Up @@ -16669,12 +16669,12 @@ msgctxt "#38103"
msgid "Extract thumbnails from video files"
msgstr ""

#: system/settings/rbp.xml
#: system/settings/rbp.xml system/settings/imx6.xml
msgctxt "#38120"
msgid "Support 8 channel DTS HD audio"
msgid "Support 8 channel DTS HD audio decoding"
msgstr ""

#: system/settings/rbp.xml
#: system/settings/rbp.xml system/settings/imx6.xml
msgctxt "#38121"
msgid "This option supports 8 channel DTS HD but may use more CPU "
msgid "This option supports 8 channel DTS HD decoding, but may use more CPU. It is only available when DTS and DTS-HD audio passthrough is disabled"
msgstr ""
20 changes: 20 additions & 0 deletions system/settings/imx6.xml
Expand Up @@ -13,6 +13,26 @@
</setting>
</group>
</category>
<category id="audiooutput">
<group id="1">
<setting id="audiooutput.supportdtshdcpudecoding" type="boolean" label="38120" help="38121">
<level>2</level>
<default>false</default>
<control type="toggle" />
<dependencies>
<dependency type="enable">
<or>
<condition setting="audiooutput.passthrough" operator="is">false</condition>
<and>
<condition setting="audiooutput.dtshdpassthrough" operator="is">false</condition>
<condition setting="audiooutput.dtspassthrough" operator="is">false</condition>
</and>
</or>
</dependency>
</dependencies>
</setting>
</group>
</category>
</section>
<section id="videos">
<category id="videoacceleration">
Expand Down
10 changes: 5 additions & 5 deletions system/settings/rbp.xml
Expand Up @@ -41,11 +41,6 @@
<default>true</default>
<control type="toggle" />
</setting>
<setting id="videoplayer.supportdtshd" type="boolean" label="38120" help="38121">
<level>2</level>
<default>false</default>
<control type="toggle" />
</setting>
</group>
</category>
<category id="myvideos">
Expand Down Expand Up @@ -114,6 +109,11 @@
<formatlabel>38102</formatlabel>
</control>
</setting>
<setting id="audiooutput.supportdtshdcpudecoding" type="boolean" label="38120" help="38121">
<level>2</level>
<default>false</default>
<control type="toggle" />
</setting>
</group>
<group id="3">
<setting id="audiooutput.ac3transcode" help="37024">
Expand Down
8 changes: 5 additions & 3 deletions system/settings/rbp2.xml
Expand Up @@ -6,9 +6,6 @@
<setting id="videoplayer.useomxplayer">
<default>false</default>
</setting>
<setting id="videoplayer.supportdtshd">
<default>true</default>
</setting>
</group>
</category>
</section>
Expand All @@ -22,6 +19,11 @@
</group>
</category>
<category id="audiooutput">
<group id="1">
<setting id="audiooutput.supportdtshdcpudecoding">
<default>true</default>
</setting>
</group>
<group id="3">
<setting id="audiooutput.ac3transcode" help="36429">
</setting>
Expand Down
10 changes: 7 additions & 3 deletions xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
Expand Up @@ -55,13 +55,17 @@ CDVDAudioCodecFFmpeg::~CDVDAudioCodecFFmpeg()

bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
{
AVCodec* pCodec;
AVCodec* pCodec = NULL;
m_bOpenedCodec = false;

if (hints.codec == AV_CODEC_ID_DTS && CSettings::Get().GetBool("videoplayer.supportdtshd"))
#if defined(TARGET_RASPBERRY_PI) || defined(HAS_IMXVPU)
if (hints.codec == AV_CODEC_ID_DTS && CSettings::Get().GetBool("audiooutput.supportdtshdcpudecoding"))
pCodec = avcodec_find_decoder_by_name("libdcadec");
else
#endif

if (!pCodec)
pCodec = avcodec_find_decoder(hints.codec);

if (!pCodec)
{
CLog::Log(LOGDEBUG,"CDVDAudioCodecFFmpeg::Open() Unable to find codec %d", hints.codec);
Expand Down
5 changes: 3 additions & 2 deletions xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
Expand Up @@ -439,7 +439,8 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput, bool streaminfo, bool filein

if (m_streaminfo)
{
if (CSettings::Get().GetBool("videoplayer.supportdtshd"))
#if defined(TARGET_RASPBERRY_PI) || defined(HAS_IMXVPU)
if (CSettings::Get().GetBool("audiooutput.supportdtshdcpudecoding"))
{
for (unsigned int i = 0; i < m_pFormatContext->nb_streams; i++)
{
Expand All @@ -448,7 +449,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput, bool streaminfo, bool filein
st->codec->codec = avcodec_find_decoder_by_name("libdcadec");
}
}

#endif
/* to speed up dvd switches, only analyse very short */
if(m_pInput->IsStreamType(DVDSTREAM_TYPE_DVD))
av_opt_set_int(m_pFormatContext, "analyzeduration", 500000, 0);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp
Expand Up @@ -66,7 +66,7 @@ bool COMXAudioCodecOMX::Open(CDVDStreamInfo &hints)
AVCodec* pCodec;
m_bOpenedCodec = false;

if (hints.codec == AV_CODEC_ID_DTS && CSettings::Get().GetBool("videoplayer.supportdtshd"))
if (hints.codec == AV_CODEC_ID_DTS && CSettings::Get().GetBool("audiooutput.supportdtshdcpudecoding"))
pCodec = avcodec_find_decoder_by_name("libdcadec");
else
pCodec = avcodec_find_decoder(hints.codec);
Expand Down

0 comments on commit 010dbbb

Please sign in to comment.