Browse Source

Minor fix to WindowsMediaAudioFormat.

tags/2021-05-28
jules 14 years ago
parent
commit
5e53e8b980
2 changed files with 18 additions and 10 deletions
  1. +10
    -4
      modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp
  2. +8
    -6
      modules/juce_audio_formats/format/juce_AudioFormatManager.cpp

+ 10
- 4
modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp 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;
}
}
}


+ 8
- 6
modules/juce_audio_formats/format/juce_AudioFormatManager.cpp 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
}


Loading…
Cancel
Save