1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Minor fix to WindowsMediaAudioFormat.

This commit is contained in:
jules 2011-12-05 11:22:47 +00:00
parent 38eb7f8a5b
commit 5e53e8b980
2 changed files with 18 additions and 10 deletions

View file

@ -38,7 +38,7 @@ public:
}
JUCE_COMRESULT Commit (DWORD) { return S_OK; }
JUCE_COMRESULT Write (void const*, ULONG, ULONG*) { return E_NOTIMPL; }
JUCE_COMRESULT Write (const void*, ULONG, ULONG*) { return E_NOTIMPL; }
JUCE_COMRESULT Clone (IStream**) { return E_NOTIMPL; }
JUCE_COMRESULT SetSize (ULARGE_INTEGER) { return E_NOTIMPL; }
JUCE_COMRESULT Revert() { return E_NOTIMPL; }
@ -145,10 +145,16 @@ public:
{
HRESULT hr = wmCreateSyncReader (nullptr, WMT_RIGHT_PLAYBACK, wmSyncReader.resetAndGetPointerAddress());
hr = wmSyncReader->OpenStream (new JuceIStream (*input));
hr = wmSyncReader->SetReadStreamSamples (0, false);
scanFileForDetails();
ok = sampleRate > 0;
if (SUCCEEDED (hr))
{
WORD streamNum = 1;
hr = wmSyncReader->GetStreamNumberForOutput (0, &streamNum);
hr = wmSyncReader->SetReadStreamSamples (streamNum, false);
scanFileForDetails();
ok = sampleRate > 0;
}
}
}

View file

@ -23,7 +23,7 @@
==============================================================================
*/
//==============================================================================
AudioFormatManager::AudioFormatManager()
: defaultFormatIndex (0)
{
@ -62,10 +62,6 @@ void AudioFormatManager::registerBasicFormats()
registerFormat (new WavAudioFormat(), true);
registerFormat (new AiffAudioFormat(), false);
#if JUCE_MAC || JUCE_IOS
registerFormat (new CoreAudioFormat(), false);
#endif
#if JUCE_USE_FLAC
registerFormat (new FlacAudioFormat(), false);
#endif
@ -74,7 +70,13 @@ void AudioFormatManager::registerBasicFormats()
registerFormat (new OggVorbisAudioFormat(), false);
#endif
#if JUCE_USE_MP3AUDIOFORMAT
#if JUCE_MAC || JUCE_IOS
registerFormat (new CoreAudioFormat(), false);
#elif JUCE_WINDOWS
registerFormat (new WindowsMediaAudioFormat(), false);
#elif JUCE_USE_MP3AUDIOFORMAT
// The software MP3 decoder is only used as a default format if
// there isn't an OS-provided alternative.
registerFormat (new MP3AudioFormat(), false);
#endif
}