-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rebase and update stb_vorbis.h to SDL_sound's version : #395
Conversation
- Keeps the original stb_vorbis as intact as possible so that future updates from mainstream would be painless. - Reduces STB_VORBIS_MAX_CHANNELS from 16 to 6 (objections?) - Adds several missing libm function overrides, - SDL_mixer now requires SDL >= 2.0.9 because of SDL_exp() - Fixes slow loads and leaks in start_decoder: nothings/stb#1174 - Fixes submap array out-of-bounds indexing bug: nothings/stb#1312 - Replace signed overflow clamps with unsigned overflow: nothings/stb#1168 - Replaces alloca() usage with setup_malloc() (from libxmp.) - Fixes '-Wmaybe-uninitialized' warnings in get_seek_page_info: nothings/stb#1172 - A minor UBSan fix and suppression: nothings/stb#1168 - Fixes signature of dummy realloc() for STB_VORBIS_NO_CRT: nothings/stb#1198 - Renames BUFFER_SIZE macro to STB_BUFFER_SIZE: nothings/stb#1078 - Pulls in sample-accurate offset patch of Vitaly Novichkov: (stb_vorbis_get_playback_sample_offset, because it's used in OGG_Tell and OGG_GetSome): nothings/stb#1294 nothings/stb#1295 - Fixes a few warnings here and there in some environments. - Replaces two dummy '(void) 0' with 'do {} while(0)'
One noticeable difference is this changes I don't know the reason Vitaly's Sint64 change: If there is a compelling |
That was my new feature, it's VERY important as original call adds the bug at looping, it requires a sample accurate seek/tell. I changed to Sint64 to match the 64bit off_t and value at original vorbis. |
I don't know what that means??
Well, stb_vorbis mainstream doesn't follow that. @slouken what do you think? |
I can't imagine having a music file that's larger than 2 billion samples. int should be fine for the range that we're working with. @Wohlstand, do you have a repro for the original bug you were fixing with that change? Other than that outstanding question, I'm fine with merging this so our stb_vorbis.h is in line with SDL_sound. |
OK, waiting for @Wohlstand's answer before merging. |
Also, forgot to tell: plain 32bit signed integer is able to address ~3 hours of 198000 kHz audio (there are some audio footages as an example, they may contain a lot of hours of audio, I do have some files with 5 hours of cocert recording sent by my friend a while ago, and I worry they may easily get overflow and fail).Отправлено с устройства Galaxy
-------- Исходное сообщение --------От: Ozkan Sezer ***@***.***> Дата: 21.05.2022 17:05 (GMT+03:00) Кому: libsdl-org/SDL_mixer ***@***.***> Копия: Vitaly Novichkov ***@***.***>, Mention ***@***.***> Тема: Re: [libsdl-org/SDL_mixer] Rebase and update stb_vorbis.h to SDL_sound's version : (PR #395)
it's VERY important as original call adds the bug at looping,
I don't know what that means??
I changed to Sint64 to match the 64bit off_t and value at original vorbis.
Well, stb_vorbis mainstream doesn't follow that.
@slouken what do you think?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
One of my users sent me some OGG files that got a click on loop passing because of that bug I explained (that caused me to implement a new call for the sample-accurate seek). |
Do you still have the looping Ogg file for testing? |
Is that bug related to the Sint64 change, or is it only about implementing the new |
|
There are different and independent changes that fixing different cases:
|
I wasn't opposing to the new As for Sint64 return: @slouken, what do you say? |
I'm not opposed to updating that to 64-bit. I think maybe make a PR with use case against upstream and see if the original author thinks it's a good idea? |
Yes. Merging this now. Vitaly: Can you create a bug entry here and get the idea of Sean Barrett about Sint64? |
For the loop bug:
Sure, I still seek at my archive for mentioned concert recordings... |
Ok, here are the ones changed from Sint64 to what it originally was,
|
P.S. the huge problem is using C++ single-line comments at original stb_vorbis, which caused incompatibility with C90 compilers, that is why I replaced all comments with |
Maybe, but that causes difficulties when we want to apply mainstream changes. |
P.P.S. About the length of these concert footages, they have 10 hours each. |
BTW, speaking in general, if use single-line comments in Pure-C, it's fine in the scope of project code, but speaking about public headers, they must follow the C90 standard to guarantee any project will be able to use it. Anyway, for this case, I'll post the issue on the mainstream side. (made nothings/stb#1328) |
About the Sint64, I made the issue: nothings/stb#1329 |
OK, I'll watching that ticket. |
that future updates from mainstream would be painless.
stb_vorbis: fix slow loads and leaks in start_decoder. nothings/stb#1174
stb_vorbis: extend Mapping submap_floor and submap_residue. nothings/stb#1312
stb_vorbis: Undefined behavior found by libFuzzer/UBSan. nothings/stb#1168
stb_vorbis: fix -Wmaybe-uninitialized warnings in get_seek_page_info. nothings/stb#1172
stb_vorbis: Undefined behavior found by libFuzzer/UBSan. nothings/stb#1168
Fix signature of dummy realloc() for STB_VORBIS_NO_CRT nothings/stb#1198
rename BUFFER_SIZE macro to STB_BUFFER_SIZE nothings/stb#1078
(stb_vorbis_get_playback_sample_offset, because it's used
in OGG_Tell and OGG_GetSome):
Improve the stb_vorbis_get_sample_offset() accuracy nothings/stb#1294
stb_vorbis: report the sample-accurate offset nothings/stb#1295