Browse Source

RTAS compatibility fix. Wav file fix for coping with corrupt files.

tags/2021-05-28
jules 13 years ago
parent
commit
0826b28983
2 changed files with 9 additions and 3 deletions
  1. +4
    -3
      modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp
  2. +5
    -0
      modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp

+ 4
- 3
modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp View File

@@ -85,7 +85,7 @@ namespace WavFileHelpers
uint8 reserved[190];
char codingHistory[1];
void copyTo (StringPairArray& values) const
void copyTo (StringPairArray& values, const int totalSize) const
{
values.set (WavAudioFormat::bwavDescription, String::fromUTF8 (description, 256));
values.set (WavAudioFormat::bwavOriginator, String::fromUTF8 (originator, 32));
@@ -98,7 +98,8 @@ namespace WavFileHelpers
const int64 time = (((int64)timeHigh) << 32) + timeLow;
values.set (WavAudioFormat::bwavTimeReference, String (time));
values.set (WavAudioFormat::bwavCodingHistory, String::fromUTF8 (codingHistory));
values.set (WavAudioFormat::bwavCodingHistory,
String::fromUTF8 (codingHistory, totalSize - offsetof (BWAVChunk, codingHistory)));
}
static MemoryBlock createFrom (const StringPairArray& values)
@@ -591,7 +592,7 @@ public:
HeapBlock <BWAVChunk> bwav;
bwav.calloc (jmax ((size_t) length + 1, sizeof (BWAVChunk)), 1);
input->read (bwav, (int) length);
bwav->copyTo (metadataValues);
bwav->copyTo (metadataValues, (int) length);
}
else if (chunkType == chunkName ("smpl"))
{


+ 5
- 0
modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp View File

@@ -977,7 +977,12 @@ private:
case 5: return ePlugIn_StemFormat_5dot0;
case 6: return ePlugIn_StemFormat_5dot1;
case 7: return ePlugIn_StemFormat_6dot1;
#if PT_VERS_MAJOR >= 9
case 8: return ePlugIn_StemFormat_7dot1DTS
#else
case 8: return ePlugIn_StemFormat_7dot1;
#endif
default: jassertfalse; break; // hmm - not a valid number of chans for RTAS..
}


Loading…
Cancel
Save