Comments (11)
Able to reproduce a similar issue with the
audio_music_stream
example if you deleteresources/country.mp3
.WARNING: FILEIO: [resources/country.mp3] Music file could not be opened INFO: TIMER: Target time per frame: 33.333 milliseconds audio_music_stream: raylib/src/external/dr_mp3.h:3775: drmp3_seek_to_start_of_stream: Assertion `pMP3 != ((void *)0)' failed. Aborted (core dumped)
This is fixed by #3917 but it was a separate issue. Original issue still holds.
from raylib.
Checking other formats, the .wav format also has the same double free error message, so i suspect its the same issue with drwav_uninit
. The QOA Format segfaults, i didn't investigate yet why tho
from raylib.
Able to reproduce a similar issue with the audio_music_stream
example if you delete resources/country.mp3
.
WARNING: FILEIO: [resources/country.mp3] Music file could not be opened
INFO: TIMER: Target time per frame: 33.333 milliseconds
audio_music_stream: raylib/src/external/dr_mp3.h:3775: drmp3_seek_to_start_of_stream: Assertion `pMP3 != ((void *)0)' failed.
Aborted (core dumped)
from raylib.
@RobLoach @veins1 @FishingHacks I'm reviewing this issue but I can't reproduce it. Using raylib latest version from GitHub master branch. Please, could you provide some sample code/example to review it?
from raylib.
@raysan5 To reproduce you can create an empty file and rename it to file.mp3 . Then modify audio_music_stream.c so that it loads this file.
from raylib.
Okay, sorry for the late reply, have been busy lately. The Pull Request #3966 seems to have fixed most issues, ogg, mp3, qoa, flac, xm and mod files seem to work. wav files are still broken. Taking a quick look at the pull request, it calls drwav_uninit
if the initialization failed (see raudio.c:1351
), but doesn't do the same thing for mp3 (see raudio.c:1399
). I believe that this is the issue.
My code (main.c):
#include "raylib.h"
#include "stdio.h"
int main(int argc, char **argv) {
if (argc != 2) {
printf("usage: main [file]");
return -2;
}
InitAudioDevice();
if (!IsAudioDeviceReady()) {
printf("couldn't initialize the audio device");
return -1;
}
Music stream = LoadMusicStream(argv[1]);
PlayMusicStream(stream);
while (IsMusicStreamPlaying(stream)) {
UpdateMusicStream(stream);
}
UnloadMusicStream(stream);
CloseAudioDevice();
return 0;
}
I ran the following commands (assuming we start out in an empty directory with the above source in main.c
):
$ sudo apt install build-essential git libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev
$ git clone https://github.com/raysan5/raylib.git
$ cd raylib/src
$ make PLATFORM=PLATFORM_DESKTOP
$ cd ../../
$ cp ./raylib/src/raylib.h .
$ cp ./raylib/src/libraylib.a .
$ gcc -o main main.c -I. -L. -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
$ touch test.flac test.mod test.mp3 test.ogg test.qoa test.wav test.xm
$ ./main test.flac
$ ./main test.mod
$ ./main test.mp3
$ ./main test.ogg
$ ./main test.qoa
$ ./main test.wav
$ ./main test.xm
from raylib.
Couldn't reproduce the .wav crash, but going through the code in a debugger, drwav_uninit doesn't do anything useful in our case. I think it's safe to remove it, can you confirm that removing it fixes the crash?
from raylib.
@FishingHacks @veins1 Thank you very much for reviewing this issue! Feel free to send a PR if you confirm removing drwav_uninit
fixes the crash. Thanks! :)
from raylib.
That did indeed fix the issue i was having, i created a pull request (#3986) to fix this
PS: Thanks for your incredible work on raylib
from raylib.
@FishingHacks thank you very much for reviewing this issue! 😄
from raylib.
no problem!
from raylib.
Related Issues (20)
- [rcore_desktop] Can't get size of the monitor before creating a window HOT 2
- [core] rlImGUI needs a way to consume input HOT 4
- [rcore] Calls to GetRandomValue(min, max) will always return min, if not call to InitWindow() HOT 1
- [core] PLATFORM_DRM rotate screen/window HOT 10
- Maybe possibly Invalid Default Texture? HOT 5
- requesting 5.0.1 version to fix incorrect PROJECT_VERSION in 5.0 HOT 2
- [rtextures] DDS / DXT1, DXT3 and DXT5: unit 0 GLD_TEXTURE_INDEX_2D is unloadable HOT 7
- [rcore] Replay record finish can't stop move (always keydown) HOT 2
- [rcore] The content can't be rendered correctly in fullscreen mode. HOT 3
- [rcore] `ToggleFullscreen()` not working as expected with HighDPI mode enabled HOT 2
- [rshape] Line drawing functions are no longer pixel-perfect HOT 1
- [rcore] Render issue when window is partially move outside of the monitor HOT 2
- [rcore] uncapped framerate not working properly with SDL platform HOT 3
- [rcore] Get keys that are pressed again, like chars HOT 1
- [rtextures.c] ColorToInt(RED) is UB HOT 12
- [raudio] WaveCrop() is broken HOT 1
- [rmodels] Read uninitialized values in `GenMeshTangents()` HOT 1
- [rmodels] "matModel" shader uniform is not multiplied with the push/pop matrix stack HOT 3
- [raylib-cs] WARNING: GLFW: Failed to find selected monitor HOT 1
- [rcore] Inconsistency in the API between `GetGamepadButtonPressed` and `GetKeyPressed` HOT 3
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 raylib.