Comments (2)
I manage to fix the issue. The solution is to seek to the file start before processing the metadata. Also, I have added some code to skip the unknown Pro Tools metadata.
DRWAV_PRIVATE drwav_uint64 drwav__metadata_process_unknown_chunk(drwav__metadata_parser* pParser, const drwav_uint8* pChunkId, drwav_uint64 chunkSize, drwav_metadata_location location)
{
drwav_uint64 bytesRead = 0;
if (location == drwav_metadata_location_invalid) {
return 0;
}
/* Skip unknown these chunks */
if (drwav_fourcc_equal(pChunkId, "data") ||
drwav_fourcc_equal(pChunkId, "ds64") ||
drwav_fourcc_equal(pChunkId, "fmt ") ||
drwav_fourcc_equal(pChunkId, "fact")) {
return 0;
}
/* Skip unknown Pro Tools chunks */
if (drwav_fourcc_equal(pChunkId, "minf") ||
drwav_fourcc_equal(pChunkId, "elm1") ||
drwav_fourcc_equal(pChunkId, "regn") ||
drwav_fourcc_equal(pChunkId, "umid") ||
drwav_fourcc_equal(pChunkId, "DGDA") ||
drwav_fourcc_equal(pChunkId, "JUNK")) {
return 0;
}
----------------------------------------------------------------------------------------
/* Store cursor before ds64 as we will need it to seek to the file start in order to capture metadata that is before the ds64 and fmt */
drwav_uint64 cursorBeforeDs64 = cursor;
/* For RF64, the "ds64" chunk must come next, before the "fmt " chunk. */`
----------------------------------------------------------------------------------------
/* Set cursor and seek to a position before ds64 and fmt in order to capture metadata that is before the ds64 and fmt */
cursor = cursorBeforeDs64;
if (!drwav__seek_from_start(pWav->onSeek, cursor, pWav->pUserData)) {
return DRWAV_FALSE;
}
/* Basic validation. */
from dr_libs.
Thanks for reporting this. I've finally got around to addressing this. It's in the dev branch if you were wanting to try it.
from dr_libs.
Related Issues (20)
- dr_mp3: support getting Length in ms HOT 4
- Advice for internet streaming of FLAC? HOT 2
- dr_mp3 should not assume SSE2 support for WIN32 i386 HOT 11
- dr_mp3 frameInfo never filled HOT 2
- dr_flac: crashing on Nintendo 3DS HOT 10
- How to use this on Android NDK? HOT 2
- How to update wav size info when I generating a wav file? HOT 2
- SIGSEGV when reading WAV metadata HOT 6
- DSD support HOT 1
- Support for streaming use-cases (i.e. write files without making a copy of the raw samples) HOT 2
- Make results consistent when trying to seek beyond the end of sounds.
- dr_wav 0.13.8 fails to load a .wav (invalid data) HOT 4
- dr_mp3 crash if the invalid file is loaded and uninit is called HOT 3
- Possible UB in memcpy due to non-null argument HOT 9
- dr_mp3: Remove customization of output channels and sample rate. HOT 1
- test dr_wav_playback hardcodes miniaudio include path, intended? HOT 1
- Cannot decode very short mp3 file HOT 2
- Make it compile on Cortex M0 (Raspberry Pico) HOT 6
- Suggestion for a MIDI synthesis library HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dr_libs.