Skip to content

Commit

Permalink
AESinkDirectSound: Prepare for new STREAM_TYPES
Browse files Browse the repository at this point in the history
  • Loading branch information
fritsch authored and FernetMenta committed Nov 23, 2015
1 parent d17c0c6 commit 967a092
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ bool CAESinkDirectSound::Initialize(AEAudioFormat &format, std::string &device)
wfxex.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX);
wfxex.Format.nChannels = format.m_channelLayout.Count();
wfxex.Format.nSamplesPerSec = format.m_sampleRate;
if (AE_IS_RAW(format.m_dataFormat))
if (format.m_dataFormat == AE_FMT_RAW)
{
wfxex.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
wfxex.Format.wFormatTag = WAVE_FORMAT_DOLBY_AC3_SPDIF;
Expand Down Expand Up @@ -280,8 +280,8 @@ bool CAESinkDirectSound::Initialize(AEAudioFormat &format, std::string &device)
format.m_channelLayout = m_channelLayout;
m_encodedFormat = format.m_dataFormat;
format.m_frames = uiFrameCount;
format.m_frameSize = (AE_IS_RAW(format.m_dataFormat) ? wfxex.Format.wBitsPerSample >> 3 : sizeof(float)) * format.m_channelLayout.Count();
format.m_dataFormat = AE_IS_RAW(format.m_dataFormat) ? AE_FMT_S16NE : AE_FMT_FLOAT;
format.m_frameSize = (format.m_dataFormat == AE_FMT_RAW) ? wfxex.Format.wBitsPerSample >> 3 : sizeof(float)) * format.m_channelLayout.Count();

This comment has been minimized.

Copy link
@ace20022

ace20022 Nov 24, 2015

syntax error, should be ((format.m_dataFormat == AE_FMT_RAW)

This comment has been minimized.

Copy link
@FernetMenta

FernetMenta Dec 5, 2015

Owner

@fritsch we haven't fixed this yet, right?

This comment has been minimized.

Copy link
@fritsch

fritsch Dec 5, 2015

Author

Yes - for now no windows dev had interest - so it is - as said - not even compile tested.

This comment has been minimized.

Copy link
@ace20022

ace20022 Dec 5, 2015

Even a non windows dev can fix a syntax error.

This comment has been minimized.

Copy link
@fritsch

fritsch Dec 5, 2015

Author

Yeah and even a non dev at all - that can type 130 chars about a syntax error can do that. And others with the ability to send a PR to fix a syntax error can even do that - faster - than typing on github.

At the end: someone needs to do it ...

This comment has been minimized.

Copy link
@ace20022

ace20022 Dec 5, 2015

that can type 130 chars about a syntax error can do that.

who do you mean by that?

This comment has been minimized.

Copy link
@fritsch

fritsch Dec 5, 2015

Author

It cost me more energy to reply to your posts - than it would have cost for you to just PR this missing ( ... it's already fixed ...

format.m_dataFormat = (format.m_dataFormat == AE_FMT_RAW) ? AE_FMT_S16NE : AE_FMT_FLOAT;

m_format = format;
m_device = device;
Expand Down Expand Up @@ -557,9 +557,14 @@ void CAESinkDirectSound::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList, bo
deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_FLOAT));
if (aeDeviceType != AE_DEVTYPE_PCM)
{
deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_AC3));
deviceInfo.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_AC3);
// DTS is played with the same infrastructure as AC3
deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_DTS));
deviceInfo.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTSHD_CORE);
deviceInfo.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTS_1024);
deviceInfo.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTS_2048);
deviceInfo.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTS_512);
// signal that we can doe AE_FMT_RAW
deviceInfo.m_dataFormats.push_back(AE_FMT_RAW);
}
deviceInfo.m_sampleRates.push_back(std::min(smpwfxex->nSamplesPerSec, (DWORD) 192000));
}
Expand Down

0 comments on commit 967a092

Please sign in to comment.