aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfritsch <Peter.Fruehberger@gmail.com>2016-09-08 22:03:19 +0200
committerfritsch <Peter.Fruehberger@gmail.com>2016-10-01 14:25:35 +0200
commit14e21dc81617fb7e3db4dcc06f5caa6e8d82fbd9 (patch)
tree1bed0acf152e7d6e468df498c610f7806e41cb16
parent48ae01460f9944189e5aed0f7bf3ffd49d5b800e (diff)
AESinkAUDIOTrack: Allow backported v24 API to work
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp37
-rw-r--r--xbmc/platform/android/jni/AudioTrack.cpp5
2 files changed, 21 insertions, 21 deletions
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
index 210dd93c03..161f2b3fe7 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
@@ -314,9 +314,9 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
}
int atChannelMask = AEChannelMapToAUDIOTRACKChannelMask(m_format.m_channelLayout);
+ m_format.m_channelLayout = AUDIOTRACKChannelMaskToAEChannelMap(atChannelMask);
if (m_encoding == CJNIAudioFormat::ENCODING_IEC61937)
atChannelMask = CJNIAudioFormat::CHANNEL_OUT_STEREO;
- m_format.m_channelLayout = AUDIOTRACKChannelMaskToAEChannelMap(atChannelMask);
#if defined(HAS_LIBAMCODEC)
if (aml_present() && m_passthrough)
@@ -817,27 +817,24 @@ void CAESinkAUDIOTRACK::EnumerateDevicesEx(AEDeviceInfoList &list, bool force)
if (CJNIAudioFormat::ENCODING_DOLBY_TRUEHD != -1)
m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_TRUEHD);
}
- // Android v24 can do real IEC API
- if (CJNIAudioManager::GetSDKVersion() >= 24)
+ // Android v24 and backports can do real IEC API
+ if (CJNIAudioFormat::ENCODING_IEC61937 != -1)
{
- if (CJNIAudioFormat::ENCODING_IEC61937 != -1)
+ m_info.m_wantsIECPassthrough = true;
+ m_info.m_streamTypes.clear();
+ m_info.m_dataFormats.push_back(AE_FMT_RAW);
+ m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_AC3);
+ m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTSHD_CORE);
+ m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTS_1024);
+ m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTS_2048);
+ m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTS_512);
+
+ if (supports_192khz)
{
- m_info.m_wantsIECPassthrough = true;
- m_info.m_streamTypes.clear();
- m_info.m_dataFormats.push_back(AE_FMT_RAW);
- m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_AC3);
- m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTSHD_CORE);
- m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTS_1024);
- m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTS_2048);
- m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTS_512);
-
- if (supports_192khz)
- {
- m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_EAC3);
- // not working yet
- // m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTSHD);
- // m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_TRUEHD);
- }
+ m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_EAC3);
+ // not working yet
+ // m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTSHD);
+ // m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_TRUEHD);
}
}
}
diff --git a/xbmc/platform/android/jni/AudioTrack.cpp b/xbmc/platform/android/jni/AudioTrack.cpp
index 176fca9a8a..619dfc5bfb 100644
--- a/xbmc/platform/android/jni/AudioTrack.cpp
+++ b/xbmc/platform/android/jni/AudioTrack.cpp
@@ -143,7 +143,10 @@ int CJNIAudioTrack::write(char* audioData, int offsetInBytes, int sizeInBytes)
}
else if (m_audioFormat == CJNIAudioFormat::ENCODING_IEC61937)
{
- written = call_method<int>(m_object, "write", "([SIII)I", m_buffer, (int)(offsetInBytes / sizeof(short)), (int)(sizeInBytes / sizeof(short)), CJNIAudioTrack::WRITE_BLOCKING);
+ if (CJNIBase::GetSDKVersion() >= 23)
+ written = call_method<int>(m_object, "write", "([SIII)I", m_buffer, (int)(offsetInBytes / sizeof(short)), (int)(sizeInBytes / sizeof(short)), CJNIAudioTrack::WRITE_BLOCKING);
+ else
+ written = call_method<int>(m_object, "write", "([SII)I", m_buffer, (int)(offsetInBytes / sizeof(short)), (int)(sizeInBytes / sizeof(short)));
written *= sizeof(short);
}
else